youtube icon indicating copy to clipboard operation
youtube copied to clipboard

autoplay quickfix

Open ImprovedTube opened this issue 2 years ago • 5 comments

AirRaid Videos don't always auto-pause when navigating to them. Is there something I should look for; other than disabling Player\Auto-play?

AirRaid And yeah, confirming - it was pageType === "video" and pageType === "channel"

  • undoing the use of the pageType function for now: https://github.com/code-charity/youtube/commit/4491a2cd74503c3466a3f256f157132768fd6727
    • the original author might had a reason not to use that there.

https://github.com/code-charity/youtube/blob/2a88783398daa257dfa08f6d05517432d4d347d5/js%26css/web-accessible/functions.js#L246-L258

  • also the timing of above function is slightly later through: https://github.com/code-charity/youtube/commit/f5d8593eb588925d86f06c228561ccd61f14fb3c
    • as of: https://github.com/code-charity/youtube/blob/2a88783398daa257dfa08f6d05517432d4d347d5/js%26css/extension/init.js#L58-L65

ImprovedTube avatar Jun 10 '23 20:06 ImprovedTube

https://github.com/code-charity/youtube/commit/dc0dc715972cfed6d0c940fd5d60edc75bc84e24

ImprovedTube avatar Jun 10 '23 20:06 ImprovedTube

There must be another more efficient way of disabling autoplay. Current https://github.com/code-charity/youtube/blob/f6e49b11fea9bedd7f471a884675485cc59e8f31/js%26css/web-accessible/functions.js#L296 still allows for a sub second play time and fetches few seconds of video to a buffer :(. On the other hand YT detects if viewport is visible/tab active and will not start playing at all if you open YT page in the background until you switch to that tab.

raszpl avatar Jun 13 '23 20:06 raszpl

There must be another more efficient way of disabling autoplay. Current

https://github.com/code-charity/youtube/blob/f6e49b11fea9bedd7f471a884675485cc59e8f31/js%26css/web-accessible/functions.js#L296

still allows for a sub second play time and fetches few seconds of video to a buffer :(. On the other hand YT detects if viewport is visible/tab active and will not start playing at all if you open YT page in the background until you switch to that tab.

hi! @raszpl, btw

should we try the stop() function as possible or repeatedly within 0.x seconds? @dodieboy thought about this before after youtube removed a function.

this one: https://github.com/code-charity/youtube/blob/6f6a592a14834c4fd3aba890a30498904f2823e2/js%26css/web-accessible/functions.js#L173-L176 was placed critically/misplaced, because depending what changes over time during the sessions, our mutation handler could reach there too (https://github.com/code-charity/youtube/blob/master/js%26css/web-accessible/init.js )

ImprovedTube avatar Apr 03 '24 18:04 ImprovedTube

stop() function as possible or repeatedly within 0.x seconds?

pause works fine in other extensions, just need to slightly rework where its being called as for reliably pausing every time this needs to be removed https://github.com/code-charity/youtube/blob/7014a799a8f2facdbf073875b410fa130469f019/js%26css/web-accessible/www.youtube.com/player.js#L18-L21 I have no idea what its for, but its breaking autoplayDisable

raszpl avatar Apr 04 '24 08:04 raszpl

https://github.com/code-charity/youtube/pull/2157#issuecomment-2036482930

ImprovedTube avatar May 06 '24 10:05 ImprovedTube