SponsorBlock icon indicating copy to clipboard operation
SponsorBlock copied to clipboard

With Video Speed Controller installed, sometimes sponsor not skipped

Open garyking opened this issue 4 years ago • 18 comments

With the Video Speed Controller Chrome extension installed, if you set the speed of a video high enough (like 2.0x), and then come across a sponsor, then the sponsor is sometimes not skipped (probably fails to skip about 40% of the time). Rather than installing this extension, you can probably also change the video speed using YT's options, for the same effect.

Sample video I was using is this one.

garyking avatar May 26 '20 22:05 garyking

Can you try changing the speed normally and see if it's something special with the extension? I have made sure it works on 2x speed with the normal player controls, but maybe there is a bug.

ajayyy avatar May 26 '20 22:05 ajayyy

The extension interacts with the video the same way that the YT setting does. Because if you change the speed with the extension, then the YT setting will update to reflect the new speed. So if you change to 2x with the extension, then in the YT setting, it will show 2x as well.

The YT speed setting only goes up to 2x.

To test, I suggest using the extension, and setting the video speed to 4x. Then sponsors are much less likely to be skipped.

garyking avatar May 27 '20 18:05 garyking

I did not get any issues on my end using 10x speed using the native method (document.querySelector("video").playbackRate = 10).

Is this occurring on small segments? Do you get this issue using the method above as well?

ajayyy avatar May 27 '20 21:05 ajayyy

I was unable to reproduce the bug again using the multiple methods provided. I'll close. I may have conflated several issues together.

garyking avatar May 28 '20 00:05 garyking

I experience this in Firefox

Just made a new FF-profile with only SB and VSC installed

At 2x by YouTube, SB worked 10/10 times tested. At 1.7x by YouTube's builtin: 5/5

With VSP at 1.7x, it sometimes got into a few seconds of the sponsor, and then skipped it, sometimes skipped it properly, and sometimes not at all

It was better at skipping after I rewound, but it's the 1st time in the video that counts for real use

My guess was that SB was waiting for a specific frame to check, and that VSP skipped that frame. Seems it's not that simple

A little testing now makes me think that SB works with VSP >90% of the time, but that's still not a great reliability number (still nervous every time a sponsor is coming up. "Am I going to have to skip this one myself?"). I found this issue because I was going to submit it myself. =)

Jonta avatar Jun 05 '20 18:06 Jonta

Aaand in the same search (is:issue speed) I now see that SB only checks every 250ms: https://github.com/ajayyy/SponsorBlock/issues/151

Jonta avatar Jun 05 '20 18:06 Jonta

It used to check every 250ms. I completely redid it to use timeouts instead (gets the current time, runs set timeout until skip starts). It divides this number by the speed to make sure it waits long enough. So, is VSP not using the native speed controls if the HTMLVideo tag?

When the timeout is triggered, SB double checks if it is in the segment and skips if so. There is no "skip frame".

ajayyy avatar Jun 05 '20 21:06 ajayyy

See the code in my first comment in this issue. Try getting (not setting) the playbackRate while running VSP. Is it correct?

ajayyy avatar Jun 05 '20 21:06 ajayyy

document.querySelector("video").playbackRate

Yes it is

Jonta avatar Jun 06 '20 11:06 Jonta

https://github.com/igrigorik/videospeed/issues/683

Video Speed hijacks the speed change events.

Solution for now: Click pause and play after every speed change.

ajayyy avatar Jul 12 '20 17:07 ajayyy

Happens for me too sometimes, very annoying

spotlesscoder avatar Jan 16 '21 13:01 spotlesscoder

@CodingSpiderFox This is fixed now on SponsorBlock's end and is just waiting for https://github.com/igrigorik/videospeed/pull/740 to be merged into videospeed

ajayyy avatar Jan 16 '21 18:01 ajayyy

Still having the same issue, I see it has not yet been merged on videospeed side.

MikaYuoadas avatar Jul 30 '21 15:07 MikaYuoadas

Im still having this issue too

benjo456 avatar Oct 24 '21 14:10 benjo456

Came to add still a trouble - I specifically use the hotkeys s(lower) and d(faster) which give +- 10% increments. Watch most things at 1.3 or 1.4x. After setting a speed change SB definitely will miss the next skip segment. Will try the pause/play trick above to retrain SB on the new speed.

frollard avatar Jun 14 '22 19:06 frollard

Still bad here too... Wouldn't be better to add a check for changed speed every 500ms or something? Don't see that introducing any appreciable load to the page, and it can only fail to sync to the user if he just changed the speed before a segment starts.

r4m0n avatar Jul 13 '22 16:07 r4m0n

add a check for changed speed every 500ms

Maybe if there is a way to detect videospeed being installed, but this would break some of the other code like the virtual speed calculation which is needed due to delay caused by bluetooth on some devices

ajayyy avatar Jul 14 '22 17:07 ajayyy

add a check for changed speed every 500ms

Maybe if there is a way to detect videospeed being installed, but this would break some of the other code like the virtual speed calculation which is needed due to delay caused by bluetooth on some devices

I have videospeed installed, but actually use a tampermonkey script to set the initial video speed. I'm not sure which part of it is actually causing problems, so I'd just add a blanket check that the current playbackRate is what we expect it to be, else than try to see if some specific extension is installed (and have to expand checks to whichever extension decides to mess with the playbackRate).

r4m0n avatar Jul 14 '22 18:07 r4m0n

Created userscript with temporarily fix for this issue, until VSC pull request is accepted. https://greasyfork.org/en/scripts/452050-sponsor-block-359-fix/code

terazoid avatar Sep 26 '22 12:09 terazoid

Interesting hack, so listening on the document makes it so that VSC's stop propagation has no effect?

ajayyy avatar Sep 26 '22 14:09 ajayyy

Yes, if event handler is attached to document with useCapture flag and before VSC adds its event listener, it will be called first. Since they attach event listener on "document ready" it might be possible to attach event listener of SB before document loads to fix this issue.

terazoid avatar Sep 26 '22 14:09 terazoid

The main issue with using document listener always as YouTube does have multiple video elements that exist at once, even when old ones are inactive (main video, channel trailer, mini player, hover preview)

ajayyy avatar Sep 26 '22 14:09 ajayyy

https://github.com/ajayyy/SponsorBlock/commit/b3efa1f787a7e160704bf8d044e1beaac3b873f7

I added a compromise fix since it seems they will never push a fix on their side. It checks every few seconds for playback rate changes

ajayyy avatar Nov 01 '23 06:11 ajayyy