notarisj / YouTube-AutoSkip

A browser extension to automatically skip ads on YouTube.
MIT License
29 stars 4 forks source link

Issue with Playback Speed Not Resetting to Normal After Skipping Ads #2

Closed JATQK closed 5 months ago

JATQK commented 9 months ago

Issue Description

After using the AutoSkip for YouTube extension on Safari 17.3 with my MacBook 14 m1Pro (macOS 14.3), I encountered a consistent issue. The extension effectively skips unskippable ads by speeding them up. However, once these ads are skipped, the video's playback speed fails to reset to the normal speed (1x) or the pre-ad speed. This results in the video continuously playing at the high speed set for ad-skipping.

Steps to Reproduce

  1. Install the AutoSkip for YouTube extension on Safari 17.3, macOS 14.3.
  2. Watch YouTube videos until you encounter two consecutive unskippable ads.
  3. Observe the extension speeding up these ads.
  4. Notice that post-ad, the video sometimes continues at high speed instead of returning to normal speed.

Expected vs. Actual Behavior

notarisj commented 9 months ago

I will try to reproduce it and push a fix. I am also using Safari 17.3 in macOS 14.3, and I've never had this issue. If you can pause the video when this happens and attach the full HTML source, it would help.

JATQK commented 9 months ago

I wanted to reproduce it and as it turns out, first try got the bug 👯

I hope that the html can provide valuable insights. 🤞

Perhaps it's worth mentioning that I'm using the extension Accelerate to adjust the speed using hotkeys. However, I had / have the belief that the manipulation of speed in your extension would not affect each other.

Buggy Speed.html.zip

notarisj commented 9 months ago

I installed Accelerate and I am getting the same issue, so there must be an incompatibility when running together.

If you check the code, I never set the playback rate back to normal. It verifies the existence of the ad overlay and then sets the rate to x16. I didn't need to because YouTube seems to set it back after the ad ends. With that said, the mutation observer implementation is calling this method multiple times, which might cause the issue. I will optimize the observer to see if it fixes it but it's tricky.

notarisj commented 9 months ago

@JATQK Check v1.1-beta where you can disable the speedup and only push forward in the ad. I haven't figured out a solution for the speedup issue with Accelerate. If you have any suggestions let me know.

notarisj commented 5 months ago

@JATQK This should be fixed now with the embed approach