Comments (13)
Any possibilities to have a working electron example?
I believe electron and "working example" are two mutually exclusive things.
from mpv-examples.
I already implemented mpv.js
but it has problems especially when it comes to shipping apps easily. Also it uses ppapi (Flash Player) so it's a no for me. It works well on development though.
Electron is not a problem. I know people don't like when using low-level techs. But you can't deny the fact that it's used.
Also. I'm pretty sure it's possible to integrate it just like you'd do it with JavaFX or Cocoa as MPV can attach itself to a window given its native handle. As of now, I can have the native handle address (I guess?) which looks like 0x16e6b040
and I can pass this to native C++ code. As I'm quite new with C++ and low-level techs, I have no idea on how to use it but it's definitely possible.
My plan would be to make a modal window (attached to a parent window) and give MPV full control over it. Seems just like what the cocoa, JavaFX, wxwidgets and other example do, right?
As I said, I can give a solid base with native bindings based on CMake if that helps.
from mpv-examples.
So not possible ? 😞
from mpv-examples.
On X11 and win32 you could embed the mpv window, but then it would cover the electron contents fully with no way to render web content over it (if that is your intention). Maybe (very maybe) you could on win32 create another window on top of that and use alpha transparency (not sure if that works), but that's the end of it.
Then you could do other crappy things, for example render web content into an image, and overlay it on mpv's OSD with mpv's overlay-add
command. Or make mpv render into an offscreen texture, copy that to CPU bitmap, and then transfer that to chromium somehow. But these are very inefficient and have other problems.
Ask Electron for a way to embed native user content (per OpenGL or whatever else there is), then we can talk.
from mpv-examples.
I'm fine with MPV taking full control of the window, I can open a modal window dedicated to this.
from mpv-examples.
@Kylart look at https://github.com/Kagami/mpv.js/
from mpv-examples.
That uses chromium's internal NaCL API, and goes through its internal WebGL layer. Rendering works just in the most basic way, sucks for performance, and might stop working altogether.
from mpv-examples.
There's really no alternative right now. Well, aside from not using Electron. 💩
from mpv-examples.
ppapi (Flash Player)
ppapi isn't flash player.
from mpv-examples.
Seems I'm mistaken indeed.
Still seems to be deprecated though
from mpv-examples.
Yes, because browsers are removing all APIs that allow them to interact with native components.
They make for horrible toolkits and you shouldn't use them as one.
from mpv-examples.
You can't share nswindow / nsview pointers across processes on macOS (i.e.: old slave mode). It does work if you are using mpv as a library in the same process though.
from mpv-examples.
It does work if you are using mpv as a library in the same process though.
That it exactly what I want to do. I am using native bindings with direct access to libmpv in the same process.
from mpv-examples.
Related Issues (20)
- multiple videos playback in same window HOT 3
- The `simple.c` doesn't work HOT 8
- MacOS compile simple.c failed HOT 5
- Memory leak [linux] [mpv 0.32] HOT 1
- golang demo
- Vala
- Rendering OpenGL with the Enlightenment Foundation Library
- is it really supposed to open a new window in qt?
- angle example?
- iup demo
- qml example to library HOT 1
- Add basic win32 example
- Capture mouse Events in qt application.
- Is there a simple way to load scripts from ~/.config/mpv/scripts ?
- crash on CFBundleGetFunctionPointerForName
- mpv-examples - qt_opengl, libmpv windows crashed HOT 2
- How can I use swiftui too HOT 1
- Qt example does not work with the current release HOT 7
- Example using an FBO HOT 5
- qt OpenGLWidget play hdr(10bits) video
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from mpv-examples.