avi12 / youtube-auto-hd

A simple browser extension for changing YouTube videos' quality based on FPS.
https://avi12.com/youtube-auto-hd
GNU General Public License v3.0
235 stars 28 forks source link

Video will not play [Bug] #67

Closed garbb closed 1 year ago

garbb commented 2 years ago

Describe the bug

Windows 10 21H2, Firefox portable 105.0.3 (64-bit) YouTube Auto HD + FPS v1.6.8 The following youtube video will not play if addon is installed. https://www.youtube.com/watch?v=KS5e-RyoJ2k

How to reproduce

The following youtube video will not play if addon is installed. Go to the URL and try to play the video. https://www.youtube.com/watch?v=KS5e-RyoJ2k

Set settings: image

Expected behavior

I notice that the linked youtube video does not have 1080p resolution available which is what I have set the add-on settings to, however I would expect the video to play at the nearest resolution instead of hanging and not playing.

What browser(s) can you reproduce the issue on?

Firefox

What OS does it occur on?

Windows

What's the version you're running?

105.0.3 (64-bit)

Additional context

No response

avi12 commented 1 year ago

Sorry for not responding, had a busy life Does the bug still occur?

garbb commented 1 year ago

Yes I upgraded the add-on to 1.6.10 and that video will still not play. I forgot to mention my settings. I have added them to the issue.

avi12 commented 1 year ago

Correct me if I'm wrong, but AFAIK Firefox by default wants to prevent autoplay regardless of the installed extensions I mean, I tested with the extension enabled and disabled, and regardless of the video I was trying to play, Firefox did not allow it to be played automatically

garbb commented 1 year ago

You are correct, however I have firefox set to allow youtube.com to automatically play videos and that video does not play automatically with the extension enabled. Have you tested in this condition? Also, with the setting set to "block audio and video" for youtube.com, the video will not even play manually with the extension enabled.

avi12 commented 1 year ago

image Firefox is set to block autoplay only to audio (the extension isn't installed), and yet the video won't autoplay at all

avi12 commented 1 year ago

I see the issue now When YTHD is enabled and YouTube is set to allow autoplay, the video will buffer endlessly, even if you manually pause and play

garbb commented 1 year ago

Sorry, I am not sure I understand your comment. Ignoring the firefox autoplay setting entirely (regardless of it being set to any of the three settings), I am unable to get the video to play at all with the extension installed (even manually by clicking on the play button). Are you able to get the video to play with the extension enabled?

https://user-images.githubusercontent.com/4453789/215129226-a68547f4-8a60-4061-b98a-2d7418d2736d.mp4

avi12 commented 1 year ago

Interesting, I get a less severe issue though On my end, the video can seemingly load but it will buffer endlessly I will begin a debugging session tomorrow though

avi12 commented 1 year ago

That's so weird The moment that this line executes (i.e. the actual quality change), https://github.com/avi12/youtube-auto-hd/blob/f82286aac28a760f573ce87accc23679eff4a3e4/src/scripts/ythd-content-script-functions-desktop.ts#L90 the player starts buffering endlessly

garbb commented 1 year ago

Weirdly the video will play OK if I set the add-on setting to 360p. But it will not work if set to 480p even though the video appears to have 480p resolution available.

https://user-images.githubusercontent.com/4453789/215142120-8ef6dd55-ef7b-4699-8f71-20321e433294.mp4

avi12 commented 1 year ago

You're right, what the heck 360p plays fine, yet on 480p it's stuck

avi12 commented 1 year ago

@garbb Can you find other videos that behave the same when the extension is active?

garbb commented 1 year ago

https://www.youtube.com/watch?v=O5HT4p6XZoo https://www.youtube.com/watch?v=PuNHrMfSM-A

avi12 commented 1 year ago

After further investigation in Brave, it seems like even when I turn off the extension, I can't load this video at 480p Instead, YouTube switches to 360p, and when I try to manually switch to 480p, the console will spit out 503 errors: image

AKA there seems to be something wrong with the network fetching of this quality

garbb commented 1 year ago

You are right, the 480p playback is just broken for those videos. I just tried in edge and firefox without the add-on enabled: If I set quality to auto it switches to 360p and plays, but if I manually select 480p it buffers forever. I guess you could have the add-on detect this and switch to a lower/another resolution until it works but this is really out of scope for what I would expect the add-on to do, so I wouldn't expect you to do this. Anyways, thanks for looking in to this.

avi12 commented 1 year ago

An interesting thing about 480p is that you can still download such a video

avi12 commented 1 year ago

I guess you could have the add-on detect this and switch to a lower/another resolution until it works

The idea makes sense, but good luck differentiating between whether the video cannot be loaded or rather the user has a slow Internet connection

avi12 commented 1 year ago

I'll close the issue now If I have anything new to report, e.g. if I have a solution, I'll reopen it