A package based on mpv.js for modern Electron apps. Replaces legacy Pepper plugin architecture used in mpv.js with a native C++ window-embedding architecture that hooks directly into the host OS window handle for zero-copy hardware acceleration. This means your video renders completely inline within your layout.
Check the example in the example folder. For the example to work, you'll need libmpv-2.dll in the project's root folder.
Note: This library only works on Windows, for now.
- Install Visual Studio Build Tools with "Desktop development with C++"
npm install github:REVENGE977/electron-libmpvTo build and run the package, you need the libmpv development files and the compiled runtime binary.
- Windows: Download libmpv. You will need
mpv.h,client.handlibmpv-2.dll.afor compilation, andlibmpv-2.dllto run your electron app.
These files and folders need to exist in your C: drive inside a folder named mpv-dev
- Development/Example: Place
libmpv-2.dllin the root of your project directory next to your mainindex.js. - Production: Ensure
libmpv-2.dllis bundled into your final Electron build directory next to the main executable or within the app's working directory so Windows can locate it at runtime.
npm run buildput libmpv-2.dll in the root folder of this project then run using
npm run example