vantezzen / skip-silence

🔇 Browser extension to skip silent parts in videos and audio files on any webpage
https://vantezzen.io/get/skipsilence
MIT License
409 stars 42 forks source link

Youtube playlists break main functionality #76

Open 1nd1g0 opened 3 years ago

1nd1g0 commented 3 years ago

Describe the bug Switching between videos in playlist makes skip silence functionality not working

To Reproduce Steps to reproduce the behavior:

  1. Open an playlist in youtube
  2. Start watching the first video
  3. Enable SS (via GUI or CTRL+SHIFT+S), mine is paid version Plus but the same applies to the free one.
  4. Wait for the second video to start or just click to it in the list
  5. SS GUI remains fully functional, but does not affect the video in any way
  6. Reload the page (F5 or GUI)
  7. Re-enable SS
  8. It works again till the next video off the list

Expected behavior For SS to work on any video loaded via playlist

Screenshots If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

Additional context Does not depend on any option. Re-enabling the Extension without page reload does not help. The most possible reason is a video player reinitialization by site's JS code dropping all the hooks, callbacks, changing IDs etc. needed for SS to work. Switching to the next video via playlist does not reloads the whole page now days, just reinitializes the player breaking SS at the same time.

1nd1g0 commented 3 years ago

The second bug - CTRL+SHIFT+S disables SS, but the playback speed does not return to normal when it is disabled. The same video played standalone (without playlist) works fine - SS restores the speed back. Reproduction:

  1. Start video off the playlist
  2. Enable SS
  3. Set normal playback speed to 2x
  4. Leave everything else as default
  5. Disable SS
  6. Video keeps playing at 2x speed
1nd1g0 commented 3 years ago

Well, it looks like SS does not work at all at any video for me now (paid Plus version in chrome). Any browser, all the other plugins disabled. Audio bar stops dancing in a few seconds after the video started, GUI works but does nothing useful - main function does not work. The speed of "normal" playback does not matter, video plays with the last speed set.

vantezzen commented 3 years ago

Thank you for your report. I'm very sorry that you experience these problems in SS4 and I will look into this today!

I think the problem with YouTube Playlists is the one you described, where they don't reload the whole page but only replace parts of it. I'll take a look at implementing a fix into Skip Silence.

SS does not work at all at any video for me now

Can you please tell me your exact Chrome version (you can go to "about:version" to find out). Before releasing I tested the plugin on multiple Browsers but didn't encounter this problem. Also did you do anything before it stopped working that could have triggered this?

vantezzen commented 3 years ago

Update: I just tried to reproduce this bug on this YouTube Playlist: https://www.youtube.com/watch?v=AA5qBbTO7IA&list=PL1XF9qjV8kH11R-SRa0g8SaB0DOUhxH5p&index=1 and it works fine. After a video change, the volume meter moves a bit slower than usual for ~1sec as YouTube is taking a lot of main thread time in the tab, but everything still works correctly and it still speeds up and slows down.

vantezzen commented 3 years ago

Can you please tell me your exact Chrome version

And also your OS and version. I tried to reproduce this on Windows 10 and macOS Big Sur with Chrome 92.0.4515.107

1nd1g0 commented 3 years ago

I could reproduce the bug on clean install VM with Chrome Version 92.0.4515.107 (Official Build) (64-bit) + Skip Silence extension. The trick was in the setting "silence speed x25". Setting the silence speed to x20 or x25 breaks SS, volume meter gets stuck and it treats everything as a silence, switching between silence speeds changes current playback speed in real time till you reload the page. The same effect for Virtual Machine with 1 core, no HW video acceleration and 2 Gb RAM and real machine with 4 cores, Intel HW video decoder and 32 Gb ram. Internet downlink is 100 Mbit.

1nd1g0 commented 3 years ago

Well, played 10 videos from playlist of 49, one by one, changing playback speed sometimes and rewinding back. Settings are the following:

Playback Speed 2x Silence Speed 10x Use dynamic threshold TRUE Sample Threshold 50 samples Keep Audio in Sync TRUE Enable Command Bar Icon TRUE Show saved time info TRUE Allow anonymous analytics TRUE

And starting circa video #5 and every next video, SS stops by itself (sets "disabled" mode in GUI), starting from video #7 volume bar hangs in the same position. uBlock Origin is active, may this cause SS to break due to advetisement skipping - I do not know, but the previous tests were without any extension other than SS and 25x/20 speed broke silence skipping.

vantezzen commented 3 years ago

Setting the silence speed to x20 or x25 breaks SS

Thank you for this info, I could reproduce this bug! It looks like setting the speed >= 20x on any page, not just YouTube, will break Chrome's MediaElement Inspection. I'll look into if this is fixable, otherwise this might just be a problem with Chromium that cannot be fixed in Skip Silence itself and needs to be reported to the Chromium team instead.

I could however still not reproduce your described error in YouTube Playlists. This might be a memory leak that causes some variable to slowly fill up until Chrome stops it. How long are the videos you tested? You described that problems started at video 5, but how long has Skip Silence been active until then? I tested the playlist for about 4 videos, 3-5 minutes each so that might be why I can' reproduce it.