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

Pause youtube video when clicking #33

Closed r7l closed 3 years ago

r7l commented 4 years ago

When clicking the button in the upper right corner, it will load the video in the background as expected and show it in a mpv window. But the video inside the browser will keep running and that makes 2 of the same video run at once.

Would it be possible to automatically pause the video inside the Firefox when clicking the ff2mpv button?

woodruffw commented 4 years ago

Would it be possible to automatically pause the video inside the Firefox when clicking the ff2mpv button?

Possibly -- it would be another WebExtension API. I'd be happy to accept a PR for this, if the answer is "yes."

woodruffw commented 4 years ago

Did some quick research on this, and it looks like it should be possible to just query the current document for <video> elements and do video.pause() on them. So it's not a special WebExtension API, but the current extension might need additional permissions to access document.

I'm happy to accept a PR for the above.