Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Embed mpv in Electron Browser Window #106

Open
rexn8r opened this issue Apr 17, 2022 · 4 comments
Open

Embed mpv in Electron Browser Window #106

rexn8r opened this issue Apr 17, 2022 · 4 comments

Comments

@rexn8r
Copy link

rexn8r commented Apr 17, 2022

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

@moxun33
Copy link

moxun33 commented Nov 10, 2022

just set transparent: true on creating BrowserWindow

@AxelTerizaki
Copy link
Contributor

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?

@rexn8r
Copy link
Author

rexn8r commented May 18, 2023

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

@smartameer
Copy link

smartameer commented Sep 11, 2023

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants