Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add possibility to mute non skipable adverts #7

Open
Runesmacher opened this issue Aug 22, 2023 · 12 comments
Open

Add possibility to mute non skipable adverts #7

Runesmacher opened this issue Aug 22, 2023 · 12 comments

Comments

@Runesmacher
Copy link

Runesmacher commented Aug 22, 2023

Would it be possible to mute advertisements that can not be skipped? Or just mute all adds in general?
These adds are usually played louder then my videos and are therefore quite annoying.

Transfered over from sponsorBlockCast #34

@gabe565
Copy link
Owner

gabe565 commented Aug 22, 2023

Great idea! This should be doable as long as I can reliably detect an ad is playing with go-chromecast.

gabe565 added a commit that referenced this issue Aug 28, 2023
@gabe565
Copy link
Owner

gabe565 commented Aug 28, 2023

Experimental support for muting ads has been added in v0.3.0! It's disabled by default, and can be enabled by passing the --mute-ads flag or by setting the env CSS_MUTE_ADS=true.

Please try it out and give some feedback in this issue.

@schumi4
Copy link

schumi4 commented Aug 28, 2023

Works for me with 0.3.2!

@nichobi
Copy link

nichobi commented Aug 28, 2023

This is very cool! One thing that might be improved is when YouTube plays multiple short ads in a row. Currently it plays the first ad for a moment before muting, unmutes when it ends, then takes a moment before it mutes the next ad. If it's possible to detect multiple ads, it would be neat to keep it muted throughout.

@gabe565
Copy link
Owner

gabe565 commented Aug 28, 2023

@nichobi I agree! That's part of the reason I have this marked as experimental for now. I'd like to keep multiple ads muted, but I also don't want the unmute to be too late or else the actual video could be muted for up to a second. For the initial feature, I decided to be more aggressive on unmute, but I'll definitely be looking to change that balance!

@Runesmacher
Copy link
Author

Love the implementation :D It was recently updated in HomeAssistant.
It does seems to only mute a second or 2 into the ad everytime, but i always have like a litle loading time before the ad shows? Maybe it can somehow detect this loading?
Can i maybe make it check faster in a setting whitout overloading the system?
As said before the unmute between ads is a thing, but it does remute them, maybe a configurable time we can find acceptable to have the main vid muted or so?

@gabe565
Copy link
Owner

gabe565 commented Sep 7, 2023

Thank you! I'll see if I can make it mute while an ad is buffering. It should be even quicker thank that, though. What do you have CSS_PLAYING_INTERVAL set to? I would recommend setting it to 500ms.

@schumi4
Copy link

schumi4 commented Sep 7, 2023

I would also suggest (maybe as an option) to mute on first ad, then keep muted in case there are multiple ads until actual video playback is detected. I would gladly sacrifice the first second of the video in order to have consistently muted adverts.

@gabe565
Copy link
Owner

gabe565 commented Sep 7, 2023

I agree, and I've actually tested that out, but unfortunately there's a bit of a tradeoff.

At the moment, it will mute if an ad is currently playing, and unmute otherwise (like if the video starts playing or if it's buffering). This seems fast enough to never cut into the actual video, but the downside is that up to the first half of a second plays for every ad (even when they play consecutively).

I tested changing that functionality so that it would mute when an ad is playing, and stay muted when buffering. This made ads mute much more quickly and fixed the issue of the second ad umuting for a split second, but once ads ended, it would stay muted for up to half of a second of the actual video.

If you think this is acceptable, I could probably add a flag to change this behavior. Some people might prefer missing a tiny bit of the video to ensure the ads are always muted.

I have one other thought I'd like to investigate first. I know Cast devices support queuing videos. I'm not sure if ads show up in the queue, but it would be really nice if I could detect if another ad was upcoming.

@Runesmacher
Copy link
Author

Thank you! I'll see if I can make it mute while an ad is buffering. It should be even quicker thank that, though. What do you have CSS_PLAYING_INTERVAL set to? I would recommend setting it to 500ms.

It is indeed set to 500ms, lately i also started noticing a lot more false positives with my video staying muted after some adds :(

@gabe565
Copy link
Owner

gabe565 commented Dec 6, 2023

@Runesmacher Oh no! Do you see anything helpful in the logs when that happens?

@Runesmacher
Copy link
Author

Seems that it was my own automation that restarts it that did it at the wrong time 😅
The adds recently started showing this new timer, maybe there is a way to read this one? It is a global timer over all adverts.
PXL_20231210_100629414 MP

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

No branches or pull requests

4 participants