Skip to content

Conversation

@vivektiwari1986
Copy link

@vivektiwari1986 vivektiwari1986 commented Oct 1, 2025

This PR introduces a new configuration option that allows users to set a specific volume level for YouTube ads instead of only having the option to completely mute them. Addresses #344

User Experience

  1. Users who don't want to completely silence ads can now set them to a lower volume (e.g., 30%)
  2. Clear prompts guide users through the configuration process
  3. Seamless integration with existing mute ads functionality

Technical Implementation

  1. Added ads_volume attribute to YtLoungeApi class with proper initialization
  2. Implemented set_volume_for_ads() method for handling volume changes during ad events
  3. Enhanced event processing in both "onAdStateChange" and "adPlaying" events

@dmunozv04
Copy link
Owner

Hi there, thanks for the PR!

I'll look it more into detail when I get some time, but I'm wondering how it's able to know the original volume if self.volume_state.get("volume") seems to get changed when the volume changes for the ad.

@vivektiwari1986
Copy link
Author

You are right. Setting on ad start will cause a eventType - onVolumeChanged and change it again. I ll add a original_pre_ads_volume that is set before ad star action.

I posted this PR for early feedback. Planning to run a test on my apple tv and lg tv app today.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants