Coder Social home page Coder Social logo

Comments (12)

gabe565 avatar gabe565 commented on June 8, 2024 2

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.

from castsponsorskip.

nichobi avatar nichobi commented on June 8, 2024 2

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.

from castsponsorskip.

gabe565 avatar gabe565 commented on June 8, 2024 1

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

from castsponsorskip.

schumi4 avatar schumi4 commented on June 8, 2024

Works for me with 0.3.2!

from castsponsorskip.

gabe565 avatar gabe565 commented on June 8, 2024

@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!

from castsponsorskip.

Runesmacher avatar Runesmacher commented on June 8, 2024

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?

from castsponsorskip.

gabe565 avatar gabe565 commented on June 8, 2024

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.

from castsponsorskip.

schumi4 avatar schumi4 commented on June 8, 2024

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.

from castsponsorskip.

gabe565 avatar gabe565 commented on June 8, 2024

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.

from castsponsorskip.

Runesmacher avatar Runesmacher commented on June 8, 2024

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 :(

from castsponsorskip.

gabe565 avatar gabe565 commented on June 8, 2024

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

from castsponsorskip.

Runesmacher avatar Runesmacher commented on June 8, 2024

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

from castsponsorskip.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.