Comments (11)
Awesome thanks!
from mediaplayerui.net.
For Desktop, there is OpenGlVideoView and NativeVideoView, what's the difference between both? NativeVideoView is not used.
And on Android, there is no OpenGlVideoView. Can't that renderer be used on Andrroid?
from mediaplayerui.net.
Refactoring is done. Now got some pretty clean code.
https://github.com/mysteryx93/LibMpv-OpenGL
For some reason, your Android version runs under "AndroidSample" folder; but I can't make my version to run. Can't figure out what I'm missing.
Also, although your Android version runs, it crashes if we try to switch windows. There's still more work to do on the Android implementation; and then iOS.
from mediaplayerui.net.
For Desktop, there is OpenGlVideoView and NativeVideoView, what's the difference between both? NativeVideoView is not used.
You will have to read the libmpv documentation to understand the difference between these player embedding technologies
https://github.com/mpv-player/mpv-examples/blob/master/libmpv/README.md (Methods of embedding the video window)
Also, although your Android version runs, it crashes if we try to switch windows. There's still more work to do on the Android
implementation; and then iOS.
Yes you are right. There is a problem when switching windows. It's probably trivial, but I don't have time to fix this bug at the moment. My interest was just to try to run on android. Perhaps in the future I will return to this problem.
from mediaplayerui.net.
Notes about iOS. There is no easy way to get compiled libmpv library for iOS. Unfortunately, I don't have a macOS computer to try it out. You will most likely have to compile it yourself for that platform.
from mediaplayerui.net.
Notes about embedding the player. It seems to be better to use native embedding under Windows to achieve better video playback results.
In my example, the implementation of naive embedding is not complete.
How to implement better, you can look at the example of the implementation of LibVLC
https://github.com/radiolondra/libvlcsharp/tree/3.x/src/LibVLCSharp.Avalonia.Unofficial
In short, there is one problem with native embedding. It is not possible in a simple way to display the control element on top of the area in which the video is played. Therefore, it is necessary to take additional actions to achieve this result. In that example, LibvLC is used as a video player. For LibMPV it will be completely similar.
from mediaplayerui.net.
I started implementing the full API of commands and properties but that's a lot of work. Properties work for basic data types, but strangely, GetAsync doesn't work on string values but works for other data types? Complex data types aren't yet implemented. Still a lot of work to do.
I'll leave it in the current state and add it to MediaPlayerUI.
Here's a TODO list.
https://github.com/mysteryx93/LibMpv-OpenGL#contributions-wanted
It may sit in the current state for a while unless someone picks up the work.
from mediaplayerui.net.
I started implementing the full API of commands and properties but that's a lot of work. Properties work for basic data types, but strangely, GetAsync doesn't work on string values but works for other data types? Complex data types aren't yet implemented. Still a lot of work to do.
Precisely because there are so many properties, I did not do this in my implementation. In addition to simple properties, there are many more properties for setting audio and video filters. Of course, the absence of mapping will not meet the classical requirements of MVVM, but this is the reality. It is not always appropriate.
from mediaplayerui.net.
I had already done the full API mapping for controlling the player via IPC controller, so I copy-pasted that; but there are quite a lot of differences and I did not finish fixing the changes.
MVVM does not apply to the library. You can create your own derived controls that implement the properties you need as MVVM, or it passes the MpvContext to the ViewModel, from there the ViewModel has full control. But the library itself doesn't care what UI or design pattern you use.
The main thing is to make it easy to test. I haven't looked into that. Your ViewModel currently takes a hard reference to MpvContext... that might need to be swapped with an interface. Could generate an interface once the API is stable.
from mediaplayerui.net.
With the full properties mapping, added auto-listening to property changes which is pretty cool. Binding to the property Changed
event and it just works by magic.
It's now working with MediaPlayerUI so I'll just publish the packages as-is. They can be fixed and improved later, but I think a decent video player for Avalonia is just overdue.
Ah, there's also the issue of making the screen black on stop.
from mediaplayerui.net.
https://www.nuget.org/packages/MediaPlayer.Avalonia.Mpv/2.0.0-rc1
from mediaplayerui.net.
Related Issues (10)
- Reference Mpv.NET for prerequisites and licensing HOT 1
- How do I play an audio file that is INSIDE the executable? HOT 7
- Can you make your repo to target .NET 5.0? HOT 8
- OpenGL Integration HOT 1
- WPF MediaPlayerHost No MediaElement_MediaStateChanged Event HOT 2
- I find a way to use mpv and opengl in Avalonia HOT 4
- How to switch the video source? HOT 3
- Does it support real-time microphone acquisition and output? HOT 1
- Build MediaPlayer.Avalonia.Sample error : "Unable to load DLL 'libmpv.2' " HOT 1
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 mediaplayerui.net.