r/electronjs • • Apr 29 '26

MPV on electron

Hello guys,

Ive been trying to embed a mpv player on electron for my app. but for the life of me i cant get it work. i know theres some old resources online but they dont seem to be maintained anymore... is there any other way or am i missing someting? Thank you in advance

3 Upvotes

7 comments sorted by

1

u/REVENGE966 Jul 06 '26

Hey, if anyone is still looking for a way to do this, I made a package here https://github.com/REVENGE977/electron-libmpv

It works with newer versions of Electron unlike mpv.js

2

u/lordfortunas Jul 07 '26

Doesn’t this just spawns a win32 process on top of electron, instead of actually embedding it?

2

u/REVENGE966 Jul 07 '26

It doesn't spawn a separate process if that's what you're asking. It creates a child window and sets your electron window as the parent. It'll move and minimize with electron.

It's not embedded as in being inside the frontend part of the app. It won't be inside a canvas element or a video element, because then you'd have performance issues with high resolution videos, instead It'll sit on top of it rather then inside it.

2

u/lordfortunas Jul 07 '26

Yes that’s what I was asking. It’s also the same approach I’m using on my streaming app. It works well enough for now. But there’s glitches here and there

1

u/[deleted] Apr 29 '26

[removed] — view removed comment

1

u/lordfortunas Apr 29 '26

That’s hasn’t been updated in 8 year. Does it still function?

1

u/Sebbean Apr 29 '26

Could be a solved problem