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.54k stars 542 forks source link

YouTube error: "Your browser can't play this video." when extension is active in Brave #1695

Open Saarsk opened 1 year ago

Saarsk commented 1 year ago

Updated: It now works again. I noticed the extension version number is now 4.12 (from 4.11). I had to tick the "codec h.264" option in the extension settings --> Player and then refresh page for it to be fixed. I then disabled the option again, confirming the option is not required. I also tested blocking H.264 (which is my preference, as video quality is best in AV1, worse in VP9 and worst in H.264). See my replies below for more details.


When the extension is active in Brave Browser I get this error message: "Your browser can't play this video.".

OS: Fedora 37 Browser: Brave v1.51.118 (May 17, 2023) Improve YouTube version 4.11

I've tried disabling the in-browser ad and tracker blockers, does not fix the problem. Disabling the Improve YouTube extension does fix the problem and the in-browser blockers doesn't have to be disabled. So in my case it is definitely the extension's fault. Screenshot_20230520_163524

ImprovedTube commented 1 year ago

hi! @Saarsk for some videos/rarely?
i guess you have the h264 codec feature on? ( @raszpl are we doing anything new to vp9? blocking vs avoidig only .. 🤔)


Edit: this seems to confirm relation to the h264 switch: "... 1. Failed to use vp9 codec. 2. Use only av1, avc1 codecs in high definition videos. 3. Amazingly, this works fine when I google log out. (It works fine in secret mode) Posted by 이상훈 - yesterday"


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

https://github.com/code-charity/youtube/blob/0c3b00c5c2b77928d71c620b208f9e713592eedc/js%26css/web-accessible/core.js#L70-L102

ImprovedTube commented 1 year ago

anybody else? is the extension working fine in Brave to you?

raszpl commented 1 year ago

extension works fine in Brawe (under windows). Saarsk did you disable one of video codecs? if your browser doesnt support the one you left working video wont work. Currently we dont detect video support before letting users disable codecs, so its possible to disable the only one working and leave only the ones browser doesnt support.

You can add detection of this "Your browser can't play this video." and replace it with "you disabled all working codecs". Or maybe scarier warning in options. More elegant option is checking satus.user.browser.video and bigger warning when detecting no working video codecs enabled.

btw while testing this I discovered Disabling ads doesnt work anymore, at least in Brave.

Saarsk commented 1 year ago

hi! @Saarsk for some videos/rarely? i guess you have the h264 codec feature on? ( @raszpl are we doing anything new to vp9? blocking vs avoidig only .. thinking)

Edit: this seems to confirm relation to the h264 switch: "... 1. Failed to use vp9 codec. 2. Use only av1, avc1 codecs in high definition videos. 3. Amazingly, this works fine when I google log out. (It works fine in secret mode) Posted by 이상훈 - yesterday"

c225de2

https://github.com/code-charity/youtube/blob/0c3b00c5c2b77928d71c620b208f9e713592eedc/js%26css/web-accessible/core.js#L70-L102

The issue has been resolved (NOTE: I noticed the extension version number was bumped from 4.11 to 4.12, so this may or may not be an issue with the extension version I was using yesterday):

My settings at the time of the issue (before resolved): AV1 enabled in YouTube site settings (website), I tend to get AV1 videos. In the extension I had the "codec h.264" option off (which to me seems like a "force H.264 for compatibility" option). None of the codecs were blocked (I tend to block H.264 and perhaps VP9, either I forgot to do this on this machine or the setting was reset by an extension update), which means I in theory should be able to be served H.264 if the other codecs were unavailable.

It did indeed happen on all videos (I tried a bunch, old and new).

What I did to regain the ability to play videos: I tried refreshing with version 4.12 (F5, not Ctrl + F5) and the problem persisted. Then I enabled the H.264 and video playback worked (if I remember correctly I didn't have to disable it in order for the issue to be fixed). I then disabled that option and blocked H.264 as I want the newest codecs and it still worked. YouTube serves me AV1 videos (as expected).

I don't know what relevancy the new extension version has (or whether ticking the "codec h.264" option could've fixed it in 4.11 as well). I was in a hurry the other day when I posted this so I didn't do more troubleshooting.

Saarsk commented 1 year ago

extension works fine in Brawe (under windows). Saarsk did you disable one of video codecs? if your browser doesnt support the one you left working video wont work. Currently we dont detect video support before letting users disable codecs, so its possible to disable the only one working and leave only the ones browser doesnt support.

No codecs were disabled. :) And I can confirm AV1 has worked in the past (although I think software decoding, I get hardware decoding of all codecs in MPV and for some in FireFox. Haven't looked too much into it in Brave (Chromium). Drivers and codecs are "freeworld/non-free"). My APU is Ryzen 7 6850U (Radeon 680M).

You can add detection of this "Your browser can't play this video." and replace it with "you disabled all working codecs". Or maybe scarier warning in options. More elegant option is checking satus.user.browser.video and bigger warning when detecting no working video codecs enabled.

I assume you're talking to the devs? The problem with this is that, if the codecs weren't disabled then the message isn't true and therefore not helpful. Which would be the case in this particular instance.

btw while testing this I discovered Disabling ads doesnt work anymore, at least in Brave.

I tested this now and it works for me, the extension blocks ads. I disabled the in-browser blockers and tried the extension option. Had to refresh for it to work, which makes sense.

Additional context, yesterday before issue was resolved: I'll add that I did try enabling ad blocking in the extension (it was ticked off as "ads on"), none of the extension-specific ad options resolved the issue. I always refresh by F5 after trying different settings.

raszpl commented 1 year ago

None of the codecs were blocked (I tend to block H.264 and perhaps VP9, either I forgot to do this on this machine or the setting was reset by an extension update), which means I in theory should be able to be served H.264 if the other codecs were unavailable.

the only explanation is both H.264 and VP9 blocked. At that point Extension config page Player section would display in RED that video wont work.

Then I enabled the H.264 and video playback worked

that confirms H.264 was blocked before

(if I remember correctly I didn't have to disable it in order for the issue to be fixed). I then disabled that option and blocked H.264 as I want the newest codecs and it still worked. YouTube serves me AV1 videos (as expected).

sadly its not that simple, YT prefers to serve VP9 and only usually only goes for AV1 when higher resolution is selected. There is currently no way of dynamically forcing YT into one type of codec without breaking video completely.

I don't know what relevancy the new extension version has (or whether ticking the "codec h.264" option could've fixed it in 4.11 as well).

Ticking "codec h.264" force cleared other blocks. Overriding codecs didnt work at all until 3 weeks ago :) https://github.com/code-charity/youtube/issues/1668#issuecomment-1530726133 Its possible you had all codecs disabled for like a year and didnt notice any problems because those options were inactive/broken until my fix :)

extension works fine in Brawe (under windows). Saarsk did you disable one of video codecs? if your browser doesnt support the one you left working video wont work. Currently we dont detect video support before letting users disable codecs, so its possible to disable the only one working and leave only the ones browser doesnt support.

No codecs were disabled. :)

The way extension menu works its not super obvious, currently you see list of enabled codecs, but extension doesnt check against what your browser supports.

And I can confirm AV1 has worked in the past

AV1 alone will result in "Your browser can't play this video." message :/ YT is weird like that, it absolutely needs either VP9 or h264 working.

I assume you're talking to the devs?

yes, sorry :)

The problem with this is that, if the codecs weren't disabled

definitely were disabled :) we need to work on communicating stronger to the user that this might/will break video.

btw while testing this I discovered Disabling ads doesnt work anymore, at least in Brave.

I tested this now and it works for me, the extension blocks ads. I disabled the in-browser blockers and tried the extension option. Had to refresh for it to work, which makes sense.

interesting, doesnt work for me on fresh brave and only improvetube installed, maybe it works if user is logger into YT?

Saarsk commented 1 year ago

sadly its not that simple, YT prefers to serve VP9 and only usually only goes for AV1 when higher resolution is selected. There is currently no way of dynamically forcing YT into one type of codec without breaking video completely.

I check the "stats for nerds" to confirm that I get AV1. :) I do set highest resolution quality available, though, so that could be why VP9 is rare for me.

My understanding is that they definitely want everyone on AV1 but use it where it's most beneficial right now and also need more time for re-encoding. And for compatibility reasons also still offers several codec generations back.

the only explanation is both H.264 and VP9 blocked. At that point Extension config page Player section would display in RED that video wont work.

-

that confirms H.264 was blocked before

-

Ticking "codec h.264" force cleared other blocks. Overriding codecs didnt work at all until 3 weeks ago :) #1668 (comment) Its possible you had all codecs disabled for like a year and didnt notice any problems because those options were inactive/broken until my fix :)

Hmm, so you're saying this could have reset the state of the codec blocking settings? I assume there is no log to confirm this. I wish I checked that menu before testing the force H.264 option.

It is possible I blocked both VP9 and H.264, as long as the force H.264 reset the codec block settings. Which then led me to believe no codecs were blocked as previous settings were reset.

The strange thing about this is that video playback worked a couple days back. And I didn't touch the extension settings. Maybe I was just behind on extension version and the codec overriding behaviour didn't become active until the day I posted this issue?

AV1 alone will result in "Your browser can't play this video." message :/ YT is weird like that, it absolutely needs either VP9 or h264 working.

I just tested this (blocking both VP9 and H.264) and the error appeared. Even though I get AV1 when I re-enable VP9. That is weird, indeed.

definitely were disabled :) we need to work on communicating stronger to the user that this might/will break video.

I'll take your word for it. I wish I checked that menu before hitting the H.264 force option.

Regarding communicating a warning, version number is now 4.13 on my end and blocking all but AV1 promped a warning saying it would break playback. So that's good.

interesting, doesnt work for me on fresh brave and only improvetube installed, maybe it works if user is logger into YT?

That could be, I am indeed logged in. I tried opening an incognito window (without logging into YouTube) and the ad blocker didn't work. Brave's blocker worked, though. So that's interesting. :p

raszpl commented 1 year ago

Code tries to be clever and warn at every step about consequences, but that wasnt the case pre 3 weeks ago :) Its feasible some people experimented with disabling codecs, saw nothing happening and forgot about it leaving vp9/264 blocked.

Which then led me to believe no codecs were blocked as previous settings were reset.

if only AV1 was left enabled there wouldnt even be red text about broken video :( I need to add that. https://github.com/code-charity/youtube/pull/1696

Regarding communicating a warning, version number is now 4.13 on my end and blocking all but AV1 promped a warning saying it would break playback. So that's good.

but only when disabling codecs, once you move up to Player section everything looks fine with only AV1 enabled :( totally my fault

That could be, I am indeed logged in. I tried opening an incognito window (without logging into YouTube) and the ad blocker didn't work. Brave's blocker worked, though. So that's interesting. :p

ha, so google servers different page variant depending on logged in status, and extension currently only handles one of them. Thank you for verifying.

ImprovedTube commented 1 year ago

ha, so google servers different page variant depending on logged in status, and extension currently only handles one of them. Thank you for verifying.

hi @raszpl

few other things might are also be affected by login-state. And some accounts might get changes sooner ( including the mysterious playlist-reverse-button bug #1544 )

And to add a grain of confusion to ad-blocking: