mpv-player / mpv

🎥 Command line video player
https://mpv.io
Other
27.87k stars 2.87k forks source link

video.js within browser ? #13542

Closed foxjaw closed 6 months ago

foxjaw commented 6 months ago

Is there any project that uses video.js from the browser with mpv as a backend ?
Would be great if it exists, so that I can play media directly through browser, with mpv like capabilities.

Dudemanguy commented 6 months ago

IIRC there was some plugins on firefox for this back when NPAPI addons were a thing. I don't believe anyone has been able to do anything like that since then. Most solutions now are essentially opening the url in mpv so it opens a separate window.

foxjaw commented 6 months ago

Yup I understand the project is mainly a CLI toolkit for media playback. But the pseudo interface exists and it's already very lightweight such that any browser can be capable of rendering it.
The main thing I'm expecting, are mpv core capabilities such as zooming, stream changing, brightness/contrast/saturation etc & scripts.

The browsers these days have become the home for everything. They became their own operating system that one can live in.

po5 commented 6 months ago

While supporting all mpv rendering options in the browser would be a pain and likely perform very poorly, if all you need is the Lua scripting and UI aspects it's doable.
I was working on reimplementing the event loop and mpv core functions/properties a year ago with fengari for js/lua interop and jassub for UI, in a way that it could mpv-ify any video element through a browser extension or userscript.
Didn't get far enough for anything useful to work since it's all stubbed out, but at least mfpbar gets through init without crashing. If you want the code: mpv-web.zip Note this needs a local web server because of CORS.

foxjaw commented 6 months ago

@po5 Thanks a lot. Although I'm not a dev, I would hope someone can pick this upon the future interests that arise.
Btw, that mfpbar's website is crazy !