-
-
Notifications
You must be signed in to change notification settings - Fork 536
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
autoplay problem #2042
Comments
hi @nairblyL since when? |
As far as I can tell since the fix for the looping issue. |
since ~couple of weeks. Its really weird. sure enough
I can see multiple "autoplay:off - should we pause here again?" in console log, this is to blame. This broke it dc00a7e "fixes & tidy" is not a great commit message to put it mildly :) cant see what issue this is supposed to fix |
broken on latest firefox release as well |
and its broken completely now after reverse to broken version #2105 (comment) |
@ImprovedTube what was the purpose of autoplayDeniedOnce introduced in dc00a7e this breaks "disable Autoplay" |
The log is friendly: It points out probably unnecessary extra runs. The commit message missed to mention #1809 (comment). (if you find that undoing the commit helps @raszpl, we can just make sure that it won't pause long after the page-load or after the user clicks
One way to semi fix this might be to detect this happening and re-initialize autoplay/volume and whatever else Similar might happens or have increased since youtube's update including adblocker alerts (October 18, 2023) You'd probably enjoy at the top of our To-Do-List to simply allow everyone to enable/disable all of youtube's experiment flags (up to 800?) - (and crowdsourcing what they even mean): #1851 (comment)
...while most maintainers work alone most of the time..(, some commit messages might only express justifiable confidence that it might be uncritical enough or include noise, not rewarding enough to go back anytime soon just to document each bit.) All of which should lead to thinking of more team-work and better collaborative tools!(?) |
my comment moved from #2109 1 We have a feature called "autoplay" 'player_autoplay' while it should be called "Disable Autoplay", #2110 addresses this 2 ignore_autoplay_off is confusing, renaming to user_interacted better reflects its role. User clicking on a page = user interacting = need to pass HTMLMediaElement.prototype.play no matter other settings 3: youtube/js&css/web-accessible/init.js Line 98 in cac7962
youtube/js&css/web-accessible/functions.js Line 325 in cac7962
both are too late, this is the reason for up to 1 second play even with autoplay disabled, something 39ada0f failed to fix This needs to be on top of init.js just like the 30fps and codec overrides so it catches before YT starts interacting with the page. |
hi! 🎉 yes, AutoplayOFF should be fast (or notice if the user already clicked the player, play button, or a shortcut to play. And i think someone started considering more user interaction, when there once was some unwanted/unclear pausing during youtube navigation.) (Different story you might remember: #1508) Pseudo-code :PlayOrPause? () {is this tab active(Case A) or in the background?(B)
AND is this video a "next video"?[1.AI suggestion 2.my playlist 3. public playlist]
( OR a new page-load[4.after restoring a browser session|clicking[a Link?
[5. external|6.internal|7."related video"]|8.bookmark] | 9.embedded player?10.still invisible below the fold?)
AND was this just first activated/fully rendered after being opened in the background?(Case C)
)
AND is it music or another specific genre? AND is this from from my subscriptions or not? } So there easily is an Array with many possibilities (3*10-3)*3*2), many of which could be smart/efficient. 🤔(#1081). While case B or C might need developer attention and since v4.0 tab status code in background.js was reduced to quickly test Manifest v3. And the same could can equally be considered when deciding other parameters such as volume or speed. Long-term structure/vision for our UI:
( #848 (reply in thread), #890 (comment) ) while extra exceptions/conditions like video genre could be set for many features on right click.
👍 good (...#2111) |
https://palantir.github.io/tslint/rules/no-boolean-literal-compare/
This is how you end up with people blaming extension for Autoplay not working. Calling it what it is clears all confusion. "Force Autoplay Off" is a good start, "Disable automatic Video playback" is another one.
sounds good on paper until one of those YT features doesnt work for some reason and user blames extension because "its clearly ON in the extension ergo extension doesnt work" :) |
😆sorry @raszpl (repeated this with my head off, vaguely remembering 3cd0c66 )
Yeah! Not decided, just for the debate: Could have a strong headline like "Disable Youtube features/defaults?" Red colored list, with check-boxes, while unchecking makes the elements greyed out. (without our red glowing toggles) (+not sure how many bad reviews come from this actually - Could add a tooltip/link to browser's autoplay settings.) |
This is a great example! #1689 came about because of this backwards naming. |
Thank you for your email
…On Sat, 24 Feb, 2024, 4:38 AM nairblyL, ***@***.***> wrote:
Bug Report:
⚬ *BUG*: Videos auto play even when the option is turned off if the
window is in focus.
⚬ *HOW*: Open a video in the current window or refresh a tab with a
paused video.
Expected behaviour: The video auto pauses.
Actual behaviour: The video auto plays.
⚬ If a YouTube change started the bug, please copy the DOM you get
(especially if the bug doesn't happen when you log out or on another
computer)
⚬ Or did our last update start the bug?
⚬ ImprovedTube Version: 4.700
*1.* Thanks for coming & caring! Before submitting, please check if the
issue has already been reported ever. With GitHub's issue search (use
this link) <https://github.com/ImprovedTube/ImprovedTube/issues?q=> *(else
removing "is:issue is:open" from the standard search) ( - If it was posted
before, you can answer/react there to give it your voice and move it up in
the lists) ( - If the status is "closed" (=fixed) recently, then Web Stores
can be updated soon - if it was closed month or years ago, then it might
reappeared & must be fixed again.)*
*2. To give us a chance to solve the bug: Can you ...?:*
- ..deactivate other extensions running on YouTube? (or use an incognito
window after activating this extension to run there / *chrome://extensions
details chrome://extensions/?id=bnomihfieiccainjcjblhegjgglakjdd* )
- ..open the Browser-console, with the F12-Key, before/when the error
occures? (then hopefully you'll see an error message in the console).
- ...copy the YouTube-DOM shown above the console (F12) in case YouTube
is giving you a new verson. You can copying the root element <html> in
the top after the bug happened:
Screenshot_1171.png (view on web)
<https://github.com/code-charity/youtube/assets/25022245/ab976601-516a-40ad-970a-a5dbfc490c06>
(FireFox:) Screenshot_1170.png (view on web)
<https://github.com/code-charity/youtube/assets/25022245/d5c2cd43-b77c-4c65-b9ba-cb6e85a18d9c>
- There are 2-3 different versions depending if you open a new window or
clicked a link on youtube
⚬ Browser: Chrome 121.0.6167.185
⚬ Settings:
⚬ OS: Win10
⚬ Device:
—
Reply to this email directly, view it on GitHub
<#2042>, or unsubscribe
<https://github.com/notifications/unsubscribe-auth/A45NS753UQ3KUQIINMEJW6DYVEONJAVCNFSM6AAAAABDXO6UTKVHI2DSMVQWIX3LMV43ASLTON2WKOZSGE2TCOJTGMZTCMY>
.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
|
Ver 8.420 Disabled all extensions, and surprisingly, YT videos autoplayed. Enabled just the IT extension, and I had to manually play the videos. |
hi! @sonal-g123 did you switch off autoplay with the extension? (our feature is on when the switch if off) |
Here are my settings https://imgur.com/a/13HgKtj I just uninstalled and reinstalled your main (4.823) and Test extensions. Even with no feature on (I checked the active features setting), my videos did not play on their own. As soon as I uninstalled these apps, the autoplay began to work. I also manually tried to switch your extension's autoplay feature on and off, and tested both. For both, the videos did not play automatically. I use Chrome, if that's helpful. |
Bumping this up in case it was overlooked |
hi @sonal-g123, im not getting such error, please check the browser console. |
I finally know!
so I can see it was pausing in
Problem lies here: youtube/js&css/web-accessible/functions.js Lines 446 to 461 in 04a604b
somehow this elaborate list of conditions sometimes very rarely prevents youtube/js&css/web-accessible/functions.js Lines 438 to 441 in 04a604b
|
and there it is!
my instrumented mousedown handler:
so when I just clicked in the middle of Video window onmousedown handler triggered and managed to log Seems the easiest fix will be removing all the junk from onmousedown handler. |
Great! @raszpl At least 1 in the 3 reports we got isn't a vertical video (Firefox):
( #1809 (comment) ) For Brave & Opera GX Did repeated pausing (autoplay off, #1809) only happen in vertical videos to one of you guys? @stuart-brown @JLewis1309 ) |
hi! @nairblyL @redcat42 can you tell if this (#2042) still happens with the latest.zip? |
The Pausing happened in every video, at some point i disabled the extension again (Dont remember why) and i just today reenabled it so will see if any of the issues still show up for me |
wait,
need to see errors in console |
i might of worded it wrong, when its working properly Force Autoplay Off Enabled will make videos start paused and then when i unpause they play normally |
Next time this happen open console and copy all the errors please. Something is most likely crashing. |
Hopefully this helps Also for what its worth seems i dont have to refresh the page to get the bug to happen or go away, i enable Force Autoplay off and the video wont play when i try to unpause it, i disable the setting and i can play the video fine. all without restarting the page |
Nothing is crashing, but there is 10 video Pause events in the first screenshot. Having recently looked at shortcut code its possible it is overriding While Play is not working and you are in console run also how are you trying to play the video? with a keyboard (for example 'space') or by clicking inside the Video area with a mouse? or touch pad? |
I was clicking inside the video and pressing space on Keyboard, neither worked. Its magically working again so ill have to wait til it borks up to run that thing in console EDIT: it borked again so ran the thing |
That makes no sense, Pause code never runs with ImprovedTube.user_interacted true
|
I assume this problem hasnt been fixed yet or my Version of Improve Youtube just hasnt updated properly yet? |
hi! @JLewis1309, yes, @raszpl tried to make sure this is not our code. are you using chrome webstore? our opera versions remains at 4.580 (opera stopped publishing updates) |
Using Vivaldi now and version i have is 4.1077 and thats the latest version i see in Chrome Webstore |
thanks! @JLewis1309
(do you run other extensions for youtube? / same questions as our bug report form ) i have had this bug sometimes since youtube was new and this extension didn't exist. |
The Flags have been added to the sheet under #2042 Only Extensions i have that affect YT is ImproveTube, Return Dislike Button, and BetterTTV but even when i disabled Every Extension i have but ImproveTube the problem still happened so i dont THINK anyother extensions would be causing it but ¯_(ツ)_/¯ |
hi! @xSnufflesx thanks! so these uBO rules will make your flags the same as Logged out: If few of these fixes it, then we might have defined another very common bug exactly (as common as ImprovedTube, Youtube Premium and Vivaldi combined) youtube.com##+js(aopr, yt.config_.EXPERIMENT_FLAGS.PremiumClientSharedConfig__enable_att_context_processor, false) youtube.com##+js(aopr, yt.config_.EXPERIMENT_FLAGS.use_rta_manager_for_async, false) youtube.com##+js(aopr, yt.config_.EXPERIMENT_FLAGS.enable_high_score, false) youtube.com##+js(aopr, yt.config_.EXPERIMENT_FLAGS.enable_profile_cards_on_comments, false) youtube.com##+js(aopr, yt.config_.EXPERIMENT_FLAGS.ab_det_apb_b, true) youtube.com##+js(aopr, yt.config_.EXPERIMENT_FLAGS.live_reactions_desktop_fab_relocation_mode, 4) youtube.com##+js(aopr, yt.config_.EXPERIMENT_FLAGS.il_payload_scraping, undefined) |
Ok soo i tried adding that to uBO > "My Rules" but apparently there is some kind of syntax error so it wont save properly No clue tho if this is because adding and removing those filters did something or it just coincidentally decided to start working random again EDIT: Anddd the bug is back lol |
https://i.imgur.com/V4ua6f0.png |
Bug Report:
⚬ BUG: Videos auto play even when the option is turned off if the window is in focus.
⚬ HOW: Open a video in the current window or refresh a tab with a paused video.
Expected behaviour: The video auto pauses.
Actual behaviour: The video auto plays.
⚬ If a YouTube change started the bug, please copy the DOM you get (especially if the bug doesn't happen when you log out or on another computer)
⚬ Or did our last update start the bug?
⚬ ImprovedTube Version: 4.700
1. Thanks for coming & caring! Before submitting, please check if the issue has already been reported ever. With GitHub's issue search (use this link) (else removing "is:issue is:open" from the standard search) ( - If it was posted before, you can answer/react there to give it your voice and move it up in the lists) ( - If the status is "closed" (=fixed) recently, then Web Stores can be updated soon - if it was closed month or years ago, then it might reappeared & must be fixed again.)
2. To give us a chance to solve the bug: Can you ...?:
- ..deactivate other extensions running on YouTube? (or use an incognito window after activating this extension to run there / chrome://extensions
details
chrome://extensions/?id=bnomihfieiccainjcjblhegjgglakjdd )- ..open the Browser-console, with the
F12
-Key, before/when the error occures? (then hopefully you'll see an error message in the console).- ...copy the YouTube-DOM shown above the console (
F12
) in case YouTube is giving you a new verson. You can copying the root element<html>
in the top after the bug happened:(FireFox:)
- There are 2-3 different versions depending if you open a new window or clicked a link on youtube
⚬ Browser: Chrome 121.0.6167.185
⚬ Settings:
⚬ OS: Win10
⚬ Device:
The text was updated successfully, but these errors were encountered: