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

With Video Speed Controller installed, sometimes sponsor not skipped #359

Closed
garyking opened this issue May 26, 2020 · 23 comments
Closed

With Video Speed Controller installed, sometimes sponsor not skipped #359

garyking opened this issue May 26, 2020 · 23 comments

Comments

@garyking
Copy link

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.

@ajayyy
Copy link
Owner

ajayyy commented May 26, 2020

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.

@garyking
Copy link
Author

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.

@ajayyy
Copy link
Owner

ajayyy commented May 27, 2020

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?

@garyking
Copy link
Author

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

@Jonta
Copy link

Jonta commented Jun 5, 2020

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
Copy link

Jonta commented Jun 5, 2020

Aaand in the same search (is:issue speed) I now see that SB only checks every 250ms: #151

@ajayyy
Copy link
Owner

ajayyy commented Jun 5, 2020

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
Copy link
Owner

ajayyy commented Jun 5, 2020

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

@Jonta
Copy link

Jonta commented Jun 6, 2020

document.querySelector("video").playbackRate

Yes it is

@ajayyy ajayyy reopened this Jul 12, 2020
@ajayyy
Copy link
Owner

ajayyy commented Jul 12, 2020

igrigorik/videospeed#683

Video Speed hijacks the speed change events.

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

@spotlesscoder
Copy link

Happens for me too sometimes, very annoying

@ajayyy
Copy link
Owner

ajayyy commented Jan 16, 2021

@CodingSpiderFox This is fixed now on SponsorBlock's end and is just waiting for igrigorik/videospeed#740 to be merged into videospeed

@MikaYuoadas
Copy link

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

@benjo456
Copy link

Im still having this issue too

@frollard
Copy link

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.

@r4m0n
Copy link

r4m0n commented Jul 13, 2022

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.

@ajayyy
Copy link
Owner

ajayyy commented Jul 14, 2022

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

@r4m0n
Copy link

r4m0n commented Jul 14, 2022

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).

@terazoid
Copy link

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

@ajayyy
Copy link
Owner

ajayyy commented Sep 26, 2022

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

@terazoid
Copy link

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.

@ajayyy
Copy link
Owner

ajayyy commented Sep 26, 2022

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
Copy link
Owner

ajayyy commented Nov 1, 2023

b3efa1f

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 ajayyy closed this as completed Nov 1, 2023
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

9 participants