Node-MPV
Node-MPV copied to clipboard
Embed mpv in Electron Browser Window
Hello
I am trying to embed mpv into an electron browser window using following code:
//get browser window hwnd const winID = remote.getCurrentWindow().getNativeWindowHandle().hbuf.readInt32LE(0); const mpv = new mpvAPI({ binary: "C:\Users\UserA\mpv\mpv.exe" },["--wid=" + winID]);
await mpv.start(); await mpv.load(exePath + "\content\Demo.mp4"); console.log(await mpv.getDuration());
When i run the electron app, i don't see the video. The mpv instance seem to have started as i get the duration value in the console.
if i remomve --wid option then i can see the video window.
can any expert throw light on this issue?
thanks rex
just set transparent: true
on creating BrowserWindow
I'm late to the party but what's the actual point of embedding mpv into a window that way? mpv will cover the entire window, right? so you can't decorate it via Electron, can you?
hi @AxelTerizaki
I am developing a digital signage player application where in i would like to show video files via mpv in one zone along with other content like ticker or image banner in different zones.
the idea is to load mpv window with custom x, y, width , height on a screen with other content alongside.
thanks
With electron, i suppose we have to get the mpv stream url to run as a network stream on to a html5 video/audio/embed tag. The stream url should be on a web/http/ws/webrtc server.
Not sure if mpv supports these? #95
Ref: #83