code-charity / youtube

[top~1 open YouTube & Video browser-extension] - Enrich your experience & choice! 🧰180+ options & clever features 📌set+forget📌Longest-standing(been tough). Please join🧩us👨‍👩‍👧‍👧 ..⋮ {playback|content discovery|player|extra buttons|distractions|related videos|shorts|ads|quality|codec|full tab|full screen}
http://improvedtube.com
Other
3.5k stars 527 forks source link

Autoplay is broken #1200

Closed 1778707 closed 2 years ago

1778707 commented 2 years ago

My settings are set to open videos paused (i.e., Autoplay = off) and it's been working fine until December I think... Now, you can't start a video by clicking Play icon or hitting a spacebar on your keyboard.

Untitled

1778707 commented 2 years ago

The bug is still there and seem like nobody wants to fix it...

ImprovedTube commented 2 years ago

@1778707 firefox? @victor-savinov

ghost commented 2 years ago

@1778707 didn't find this bug in Chromium. Which browser? ImprovedTube -> Settings -> Backup & reset -> Export settings

CorazaCRZ commented 2 years ago

I have the same problem. Chrome está actualizado Versión 100.0.4867.0 (Build oficial) canary (64 bits)

{ "channel_default_tab": "/videos", "channel_trailer_autoplay": false, "forced_theater_mode": true, "ga": 1643804793441, "how_long_ago_the_video_was_uploaded": true, "language": "es", "player_ads": "block_all", "player_autoplay": false, "player_hd_thumbnail": true, "player_hide_annotations": true, "player_hide_cards": true, "player_quality": "hd1080", "player_show_cards_on_mouse_hover": true, "red_dislike_button": false, "thumbnails_quality": "maxresdefault", "up_next_autoplay": false }

ImprovedTube commented 2 years ago

Seems we got 5 reports about this now 2x Firefox 3x Chrome 1x windows11

xSnufflesx commented 2 years ago

I also noticed this recently but it seems to only be happening on Opera GX that i recently switched to but works fine in Chrome. Issue: I Open a youtube video and it immediately starts playing on Opera GX with Autoplay turned off. On Chrome I open a youtube video and it starts off paused.

This is a very annoying feature of youtube especially when you have the habit of opening SEVERAL tabs at once and they just all start blasting in your ears. Plz fix

EDIT: Of course immediately after typing this i figured out the problem even tho i felt like id already troubleshooted it quite a bit lol The Solution for me was that it was happening while watching Playlists because the Setting in Playlist > Autoplay was turned on. Player > Autoplay seems to affect normal videos and Playlist > Autoplay affects videos watched in a playlist 🤦‍♀️

ImprovedTube commented 2 years ago
thanks

thanks @jacobh12349

@victor-savinov

jacobh12349 commented 2 years ago

Your welcome

5h3i1ah commented 2 years ago

image Is it not referring to this setting, the one that automatically goes to the next video after the current one ends? Because I've noticed that it keeps turning on even though I have the setting off, and I was expecting that to be the bug being reported here. Using Firefox, with Enhancer for YouTube also installed.

ImprovedTube commented 2 years ago

Welcome @5h3i1ah ! No, Player: Autoplay literally only is meant to describe if the player starts playing after you first load a video page, or remains quiet until you click play. YouTube's "Autoplay" used to only be called 'Up next' for the most of the years. Thus our feature for this also was called 'Up next' Since Youtube renamed it, we renamed it too as 'Autoplay Up Next'. - This is what you wanted to try.

5h3i1ah commented 2 years ago

Ah, thank you for the clarification!

bobofdarkness commented 2 years ago

Hi, I noticed this issue on the Channel Home page as well. It seems that the the channel trailer "player" element uses id="c4-player" and the miniplayer uses the id="movie_player", but the miniplayer is created after the "yt-navigate-finish" event is triggered so initPlayer() is never getting called. Since video_url is only set in initPlayer and with the logic for if we are a Channel page with channel_trailer_autoplay=false it always gets to the pauseVideo() in the autoplay() function when you try to play the video.

I have: "channel_trailer_autoplay":false, "player_autoplay":true, you should be able to reproduce it on any Channel Home page with a trailer or any Channel Videos page. Note if you go from one Channel tab to another, i.e. go directly to the /videos url then click on the Home tab, you will not encounter the error.

I think if you update the ytElementsHandler function line 302: } else if (id === 'movie_player' && !this.elements.player) { to: } else if ((id === 'movie_player' || id === 'c4-player') && !this.elements.player) { I don't know if that is how you want to fix it but that would fix the issue on the Channel Home page.

The same issue happens with the miniplayer on the Channel Videos page, if you use "Add to Queue" and try to play it in the miniplayer. For this I tried adding:

        if (ImprovedTube.elements.player.closest('ytd-miniplayer')) {
            ImprovedTube.initPlayer();
        }

to the end of that same if statement and that seemed to fix it. It also applied the player customizations to the miniplayer so that was a nice bonus.

ImprovedTube commented 2 years ago

Wow Bob! 🤗👋

Jerrk commented 2 years ago

I've noticed this issue when watching livestream VODs

autoplay is off so the video doesnt start playing, but when i click play the video immediately pauses.

if i hold down the spacebar the video instantly pauses so its going forwards frame by frame.

refreshing the page doesnt help

if i turn autoplay ON the video starts playing no issue, but if i then turn it back OFF and pause the video, i cannot play it again.

EDIT: Happens sometimes on Youtube Shorts as well.

Jerrk commented 2 years ago

now started happening randomly as well. shift+refreshing the page does fix it though.

ghost commented 2 years ago

Fixed in version 4.0-alpha.1. You can wait for the beta update in the Chrome Web Store or GitHub release.