Use MPV in your C# apps
MPVSharp provides C# bindings for libmpv, a library for embedding amazing MPV player into another apps.
MPVSharp - main package, requires libmpv
to be installed on the user system or provided together with your application (works on Windows and Linux).
MPVSharp.Bundled - has libmpv
built-in (Windows 64-bit only, the build is from this repo).
API documentation is available here.
There are 2 namespaces:
Nickvision.MPVSharp.Internal
provides objects and methods that closely follow libmpv C API. You can find functions fromclient.h
inMPVClient.cs
and functions fromrender.h
inMPVRenderContext.cs
Nickvision.MPVSharp
gives you another objects that work on top ofInternal
counterpart, but provides you with various helpers and convenience functions. They are easier to use, but the API is slightly different than inInternal
, so you will probably want to read docs forClient.cs
to find what methods you can use.
Look at the examples to get the basic idea how to use MPVSharp.
There are comments in the code, but they are mostly an adaptation of some parts of comments from libmpv, which is very well documented:
Refer to MPV documentation to find the list of options, commands and properties.
GirCore example playing Charge - Blender open movie, licensed under CC BY 4.0
- Simple - basic program playing your file/link. If the file is video, a window will be created by MPV itself.
- GirCore - GTK4 application playing a video from youtube. Made with GirCore. Requires GTK4 to be installed.
- OpenGL - OpenTK application playing a video from youtube.
- .NET 7
- libmpv
This project follows the GNOME Code of Conduct.