igrigorik / videospeed

HTML5 video speed controller (for Google Chrome)
https://chrome.google.com/webstore/detail/video-speed-controller/nffaoalbilbmmfgbnbgppjihopabppdk
MIT License
3.74k stars 529 forks source link

no longer works in Disney+? #1089

Open thebgllc opened 4 months ago

thebgllc commented 4 months ago

no response to any change of settings in Disney+ today

mariusi7 commented 4 months ago

Tried to look for errors in the console. Nothing special, only one critical: "mel-hive.js:2 Accessing HLSPlayer#isLive : live state is not known until presentationState is LOADED" Nothing more logged when I change the context to VSC only (or I'm doing it wrong). https://i.imgur.com/jxlUpig.png

The player: doesn't look changed. Also, still works in Firefox with the fork (not perfect though, can't +/-). Maybe I'll debug more in the weekend if no one else has time to help with this or I get suggestions. CC @igrigorik

kraig-droid commented 4 months ago

I looked at the source code (inject.js) and saw:

var tc = {
  // ...
  // Holds a reference to all of the AUDIO/VIDEO DOM elements we've attached to
  mediaElements: []
}

OK, mediaElements will have <video ...> (and perhaps <audio ...>) elements.

Well, let's see if it finds the D+ <video ...> element. So I added a console.log:

function defineVideoController() {
    // ...
    tc.mediaElements.push(target);
    console.count('found a media element');
    // ...

Nope, no media elements found on a playing D+ vid. (Working sites do show this count.)

Why? Seems like a shadow DOM issue.

Here's some of the HTML:

...
<disney-web-player>
    #shadow-root (open)
    <div class="btm-media-client" ...>
        <video ...>
        </video>
    </div>
</disney-web-player>
...

JavaScript won't normally "reach into" shadow DOMs. I suspect that's the issue here. I see this is mentioned in another (unsolved?) issue in this repo here. But I'll see if I can figure something out.

dieblume56 commented 4 months ago

Hi,

other extensions seem to have the same problem. This developer has a solution: https://github.com/dvlden/uw-pub/issues/15

kraig-droid commented 4 months ago

I have working code on my machine. I'll be making a PR soon. Dunno if it will be accepted. Gotta' look for contributing guidelines, etc first.

kraig-droid commented 4 months ago

PR is here.

I'm not sure what's the easiest way for folks to preview/test.

One way is to:

  1. In your browser, disable your existing videospeed extension
  2. Download my code https://github.com/kraig-droid/videospeed/zipball/handle-shadow-roots/
  3. Unzip
  4. "...open Chrome/Brave/Chromium and enable developer mode via Settings > Extensions > Manage Extensions and toggle Developer mode in the top-right corner."
  5. "Click Load unpacked and browse to the folder you cloned videospeed to." (The above two steps quoted from this repo's contributing guidelines)
  6. Test it out
  7. NOTE: D+ intercepts 's' and 'd' keypresses. I had to add more keys -- I used '[' and ']' like VLC uses. If you change keys, you'll need to reload the web page for them to work.
thebgllc commented 4 months ago

First test worked flawlessly. THANK YOU!

dieblume56 commented 4 months ago

Works perfectly. Thank you very much.

Nino39x commented 4 months ago

I can't get this to work on Disney+; I'm having the same issue as before. I tried it on Max -- it worked there.

dieblume56 commented 4 months ago

I can't get this to work on Disney+; I'm having the same issue as before. I tried it on Max -- it worked there.

Can you give us some more information? Can you see the overlay in the videos? Can you see the overlay on the mainpage in all the boxes?

n3cr0cr0w commented 3 months ago

I can confirm that this patch works in @kraig-droid's upload. Unable to duplicate the fix it in the userscript version.

mariusi7 commented 3 months ago

Is there a planned release of a new version containing this ? I saw it got merged (together with some other changes).

mygsunny commented 3 months ago

it doesn't go pass 1.1x and under 0.9x

kraig-droid commented 3 months ago

it doesn't go pass 1.1x and under 0.9x

Hi, sorry, that's not enough info to troubleshoot. Is this for Disney+? Mac or PC? Chrome?

Here's a screenshot of speed 1.3 on PC, Edge (with ']' set to 'Increase speed' by '0.1'.) Clipboard01

mygsunny commented 3 months ago

it doesn't go pass 1.1x and under 0.9x

Hi, sorry, that's not enough info to troubleshoot. Is this for Disney+? Mac or PC? Chrome?

Here's a screenshot of speed 1.3 on PC, Edge (with ']' set to 'Increase speed' by '0.1'.) Clipboard01

I'm using chrome on an m1 mac with the hot key set to "[". and "]"

ldsands commented 3 months ago

It looks like you more or less have it all figured out. I found a temporary workaround in the meantime. Maybe the workaround and my observation about Hulu might help.

I found out that if you click the settings symbol/button (image shown below) in the upper right of the screen while a video is playing then the variable speed playback extension will start working.

image

I also think this is in someway tied to them incorporating Hulu into Disney+. I think this is the case because I first noticed issues with the extension working when watching something from Hulu within Disney+. The speed would not work on the Hulu videos but would work on the rest of Disney+. Then once everyone else noticed that it wouldn't work at all anywhere on Disney+ is also when I noticed the same issue throughout Disney+.

Hope this helps and either way thanks for figuring this out!

n3cr0cr0w commented 3 months ago

@kraig-droid I have seen the 0.9/1.1 issue when I use the Remember playback speed and/or Force last saved speed settings. Please retry your test.

kraig-droid commented 3 months ago

I'm using chrome on an m1 mac with the hot key set to "[". and "]"

FYI: I just tested on an Intel MacBook Pro with Chrome. Works. (I doubt silicon makes a difference -- we're way above the hardware in JS.)

kraig-droid commented 3 months ago

@kraig-droid I have seen the 0.9/1.1 issue when I use the Remember playback speed and/or Force last saved speed settings. Please retry your test.

I've never used those features and will look tonight. Are they off for you?

mygsunny commented 3 months ago

Force last saved speed settings.

@kraig-droid I have seen the 0.9/1.1 issue when I use the Remember playback speed and/or Force last saved speed settings. Please retry your test.

I've never used those features and will look tonight. Are they off for you?

wow! turning off Force last saved speed settings fixed it!

Emanuele676 commented 3 months ago

It looks like you more or less have it all figured out. I found a temporary workaround in the meantime. Maybe the workaround and my observation about Hulu might help.

I found out that if you click the settings symbol/button (image shown below) in the upper right of the screen while a video is playing then the variable speed playback extension will start working.

image

I also think this is in someway tied to them incorporating Hulu into Disney+. I think this is the case because I first noticed issues with the extension working when watching something from Hulu within Disney+. The speed would not work on the Hulu videos but would work on the rest of Disney+. Then once everyone else noticed that it wouldn't work at all anywhere on Disney+ is also when I noticed the same issue throughout Disney+.

Hope this helps and either way thanks for figuring this out!

Also for me, when the extension doesn't work and I click on that symbol to get it to work again, I can't change the speed except by -/+0.1 (I had set an initial speed of 1.7x, so it went from 1.6x to 1.8x). This had happened to me in the past with Apple TV+ as well.

I'm not sure if the speed shown is actually the one running, however, I refreshed the page and it started working normally again, so I couldn't do any further testing, it often happens that by refreshing several times suddenly it starts working again without having changed anything.

mariusi7 commented 2 months ago

Can this be fixed, since it was integrated ? When can we expect a new version released @igrigorik ? 2 months of not working on Disney (well, except workaround to load the zip)... :(

lucasgondim commented 2 months ago

It looks like you more or less have it all figured out. I found a temporary workaround in the meantime. Maybe the workaround and my observation about Hulu might help.

I found out that if you click the settings symbol/button (image shown below) in the upper right of the screen while a video is playing then the variable speed playback extension will start working.

image

I also think this is in someway tied to them incorporating Hulu into Disney+. I think this is the case because I first noticed issues with the extension working when watching something from Hulu within Disney+. The speed would not work on the Hulu videos but would work on the rest of Disney+. Then once everyone else noticed that it wouldn't work at all anywhere on Disney+ is also when I noticed the same issue throughout Disney+.

Hope this helps and either way thanks for figuring this out!

Worked for me, thanks!

kraig-droid commented 1 month ago

Thanks for the report. My quick test also confirms something isn't working. Oddly, after setting 'force last saved' to on and then starting a D+ vid, I'm able to go to 1.1 and back to 0.9 but never anything else. I'll investigate.

On Fri, May 31, 2024 at 8:53 AM Marius I. @.***> wrote:

So the fix (now deployed as 0.7.4) works only if Force Last Saved is off. When on, it stays at 1.0 and doesn't budge. But with Force=off sometimes other players reset on next video or episode (happened to me on YouTube playlists or Prime)...

— Reply to this email directly, view it on GitHub https://github.com/igrigorik/videospeed/issues/1089#issuecomment-2142439052, or unsubscribe https://github.com/notifications/unsubscribe-auth/AGJ7YD73RXPLZDB6TUPOF63ZFCFF7AVCNFSM6AAAAABEBBJ476VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCNBSGQZTSMBVGI . You are receiving this because you were mentioned.Message ID: @.***>

kraig-droid commented 1 month ago

I made an additional PR to fix the issue with forceLastSavedSpeed and shadow DOM players like D+.

PR is here.

I'm not sure what's the easiest way for folks to preview/test.

One way is to:

  1. In your browser, disable your existing videospeed extension
  2. Download my code https://github.com/kraig-droid/videospeed/zipball/fix-shadowRoot-events/
  3. Unzip
  4. "...open Chrome/Brave/Chromium and enable developer mode via Settings > Extensions > Manage Extensions and toggle Developer mode in the top-right corner."
  5. "Click Load unpacked and browse to the folder you cloned videospeed to."
  6. (The above two steps quoted from this repo's contributing guidelines)
  7. Test it out
  8. NOTE: D+ intercepts 's' and 'd' keypresses. I had to add more keys -- I used '[' and ']' like VLC uses. If you change keys, you'll need to reload the web page for them to work.

@mariusi7 -- I'm hoping you can take a look, thanks!

dallinfarrer commented 1 month ago

I have discovered something really odd. The playback speed controls started working for me today. I clicked the subtitle settings in the top right corner once the settings overlay came up, the speed bumped up to my preset. No idea what would cause this interaction, but I can now watch Disney+ at whatever speed I want.