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

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

Closed bbb651 closed 2 years ago

bbb651 commented 3 years ago

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.

woodruffw commented 3 years ago

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!

woodruffw commented 3 years ago

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

allanlaal commented 2 years ago

I can confirm this is now the default behaviour

woodruffw commented 2 years ago

Thanks for confirming. I'm going to close this for now; https://github.com/woodruffw/ff2mpv/pull/57#issuecomment-1024976999 documents what a future PR will need in order for more complex non-default functionality to be considered.