woodruffw / ff2mpv

A Firefox/Chrome add-on for playing URLs in mpv.

Home Page:https://addons.mozilla.org/en-US/firefox/addon/ff2mpv/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Seek the time the video was at in the browser in mpv

bbb651 opened this issue · comments

Is your feature request related to a problem? Please describe.
I sometimes start watching a video in a website, before wanting to continue it in mpv, and sometimes I use timestamped video links, in those cases when I use ff2mpv I would like it to continue in mpv from the same point the video was at in the browser.

Describe the solution you'd like
The json message that is sent from the extension to the native host should include another field time which would be the time in seconds from the start of the video (the <video> tag has a property currentTime that supplies it), an example message would look like {"url":"https://www.youtube.com/watch?v=YE7VzlLtp-4","time":"47.348776"}. In the python side, you can retrieve it with message.get("time") and supply it to mpv with the --start=time flag.

Describe alternatives you've considered
Seeking the time manually, I'll rather ff2mpv do it for me.

Additional context
This is a really small change that I can implement pretty quickly, I want to see if this feature is wanted, if not I'll make it into a fork.

This is a really small change that I can implement pretty quickly, I want to see if this feature is wanted, if not I'll make it into a fork.

Yes, please do!

Also, thanks for using the template. I appreciate it; it makes triaging issues much easier.

I can confirm this is now the default behaviour

Thanks for confirming. I'm going to close this for now; #57 (comment) documents what a future PR will need in order for more complex non-default functionality to be considered.