woodruffw / ff2mpv

A Firefox/Chrome add-on for playing URLs in mpv.
https://addons.mozilla.org/en-US/firefox/addon/ff2mpv/
Other
521 stars 52 forks source link

Uncaught TypeError: Cannot read properties of undefined (reading 'pause') #119

Open xusiai opened 7 months ago

xusiai commented 7 months ago

Describe the bug

When attempting to send a video to mpv in Brave the extension fails to do so.

Reproduction steps

Attempt to open any supported video

Expected behavior

Video link is sent to MPV.

Platform information

Additional context (optional)

VM496:1 Uncaught TypeError: Cannot read properties of undefined (reading 'pause')
    at <anonymous>:1:57
woodruffw commented 7 months ago

Could you provide a link for an example video that causes this error? I know you've said "any video," but having a single link to sync on will help with triage here.

(For context, I can't reproduce this on Firefox.)

xusiai commented 7 months ago

Could you provide a link for an example video that causes this error? I know you've said "any video," but having a single link to sync on will help with triage here.

https://piped.video/watch?v=DffvBIw3vMo

(For context, I can't reproduce this on Firefox.)

Firefox works fine for me too.

DanSM-5 commented 7 months ago

The type error

VM496:1 Uncaught TypeError: Cannot read properties of undefined (reading 'pause')
    at <anonymous>:1:57

happens because ffm2mpv tries to pause a video element (if any) when you send a link to mpv but the page may not have one, so this gets logged in the console of the page. It should not affect ff2mpv functionality.

I have brave installed on my steam deck through nix store and the link you provided is working. The first time I installed it I had to followed beew's comment to make it work. Also, with latest update I started getting a segfault error, so I had to roll back to brave 1.62.109. I haven't had time to dig more on the issue, so I can't say if it could be related to anything to the version from the nix store.

For better troubleshoot, please launch brave from the terminal and see what gets logged there when you use ff2mpv. It may give more clues of what is happening.

DanSM-5 commented 6 months ago

I've figured out my issue on brave from the nix package manager:

Both issues are related to non-nixOS systems, so likely unrelated to youur issue.

Something that I noticed while digging on this is that the ff2mpv package from nix only setups firefox. If that is how you installed it, you will need to manually install for brave by adding the appropriate json in brave's NativeMessagingHost folder or by running the install script.