Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
xusiai opened this issue Feb 17, 2024 · 4 comments
Open
Labels
B:chromium Support for Chromium-based browsers bug-candidate maybe a bug; not confirmed

Comments

@xusiai
Copy link

xusiai commented Feb 17, 2024

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

  • OS information: NixOS 24.05
  • Brave version: 1.62.162
  • MPV version: 0.37
  • youtube-dl version: 2023.12.30

Additional context (optional)

  • ff2mpv.json exists in $HOME/.config/BraveSoftware/Brave-Browser/NativeMessagingHosts/ and ff2mpv + mpv are accessible in $PATH.
  • First time attempting to set it up in Brave so I have never had it work there before. Works in Firefox.
  • Console shows:
VM496:1 Uncaught TypeError: Cannot read properties of undefined (reading 'pause')
    at <anonymous>:1:57
@xusiai xusiai added the bug-candidate maybe a bug; not confirmed label Feb 17, 2024
@woodruffw woodruffw added the B:chromium Support for Chromium-based browsers label Feb 18, 2024
@woodruffw
Copy link
Owner

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
Copy link
Author

xusiai commented Feb 18, 2024

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
Copy link
Contributor

DanSM-5 commented Feb 28, 2024

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
Copy link
Contributor

DanSM-5 commented Mar 30, 2024

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

  • Add a wrapper before ff2mpv.py to unset LD_LIBRARY_PATH that was inherited from the brave browser.
  • Add a wrapper for mpv to be launched with nixGL.

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
B:chromium Support for Chromium-based browsers bug-candidate maybe a bug; not confirmed
Projects
None yet
Development

No branches or pull requests

3 participants