Skip to content

Embed mpv in Electron Browser Window #106

@rexn8r

Description

@rexn8r

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions