LibVLCSharp are .NET/Mono bindings for libvlc
, the multimedia framework powering the VLC applications.
The official repository URL for this repo is https://code.videolan.org/videolan/LibVLCSharp.
- Goal
- Features
- Supported platforms
- Installation
- Getting started
- Quick API overview
- Roadmap
- Contribute
- Communication
- Code of Conduct
- License
LibVLCSharp's goal is to support all .NET runtimes (Xamarin/Mono, .NET Core and .NET Framework) on most operating systems by targeting .NET Standard 2.0.
We also aim to provide you with a custom video control integrated with the OS native UI toolkit. That means integration with UWP, Cocoa (Xamarin.Mac), GTK# and game engines with Mono support (Unity, Unreal, Godot). For a current status, see Supported platforms and Roadmap.
libvlc
is a complete, opensource and crossplatform multimedia framework written in C. On the other hand, Xamarin allows true crossplatform .NET code on all platforms and provides an efficient way to build crossplatform UIs with Xamarin.Forms.
LibVLCSharp is designed to be the connecting layer in between libvlc
and Xamarin.
Using LibVLCSharp means you can take advantage of all libvlc
features from shared managed code (C#/F#), in a true crossplatform way. You may use the features described below on all supported platforms by LibVLCSharp (Android, iOS, WPF, XForms for now, more coming soon).
Check out libvlc-nuget to get a basic understanding of how libvlc
works, what it can offer and how to install it with NuGet.
Some of the features include:
- Network browsing for distant filesystems (SMB, FTP, SFTP, NFS...).
- HDMI passthrough for Audio HD codecs, like E-AC3, TrueHD or DTS-HD.
- Stream to distant renderers, like Chromecast.
- 360 video and 3D audio playback with viewpoint change.
- Support for Ambisonics audio and more than 8 audio channels.
- Subtitles size modification live.
- Hardware decoding and display on all platforms.
- DVD playback and menu navigation.
Most things you can achieve with the regular VLC desktop app, you can also achieve using libvlc
.
- Xamarin.Android
- Xamarin.iOS
- Xamarin.Mac
- Xamarin.Forms
- Windows (WPF)
You need to install 2 packages to get started.
The first is libvlc
, which is the actual VLC engine written mostly in C/C++ and compiled for your target platform. You can find information about it and how to download it on NuGet here.
The second package you need is LibVLCSharp, the .NET wrapper that consumes libvlc
and allows you to interact with native code from C#/F#.
dotnet add package LibVLCSharp
https://www.nuget.org/packages/LibVLCSharp
If you plan to use LibVLCSharp with Xamarin.Forms, you need to install LibVLCSharp.Forms instead (which references LibVLCSharp).
dotnet add package LibVLCSharp.Forms
https://www.nuget.org/packages/LibVLCSharp.Forms/
Feel free to check out the native sample projects for iOS and Android to get started.
Basically, you need to instantiate a VideoView
and add it to your View. It handles the required libvlc
initialization for you on each platform, and offers a MediaPlayer
.NET object on which you can call Play
, Pause
, set a new media or listen for libvlc
events.
For usage of the API, you should check out the libvlc
C API documentation which this wrapper follows closely.
Regarding LibVLCSharp.Forms, check out the sample for Forms to get started.
Notably, make sure to call LibVLCSharpFormsRenderer.Init()
in your platform specific project before Xamarin.Forms.Forms.Init
is called.
VideoView.cs
: Custom view which holds aLibVLC
object and aMediaPlayer
object.LibVLC.cs
: Main object pointing to a nativelibvlc
instance in native code. Accessible fromVideoView
.MediaPlayer.cs
: Manages playback, offers event listeners and more. Accessible fromVideoView
.MediaDiscoverer.cs
: This object should be used to find media on NAS and any SMB/UPnP-enabled device on your local network.RendererDiscoverer.cs
: Use this to find and use a Chromecast or other distant renderers.Media.cs
: Class representing and providing information about a media such as a video or audio file or stream.Dialog.cs
: Dialogs can be raised from thelibvlc
engine in some cases. Register callbacks with this object.
- macOS (using GTK)
- Linux (using GTK)
- Windows 10 (using UWP, GTK)
- Game engines (Unity, Unreal, Godot)
If you have a request or question regarding the roadmap, feel free to open an issue or PR.
Pull requests are more than welcome! If you do submit one, please make sure to use a descriptive title and description.
You can look through issues we currently have on the VideoLAN Gitlab.
If you have any question or if you're not sure it's actually an issue, please visit our forum.
You have encountered an issue and wish to report it to the VLC dev team?
You can create one on our Gitlab or on our bug tracker.
Before creating an issue or ticket, please double check for duplicates!
Want to quickly get in touch with us for a question, or even just to talk?
You will always find someone from the VLC team on IRC, #videolan channel on the freenode network.
If you don't have an IRC client, you can always use the freenode webchat.
Please read and follow the VideoLAN CoC license.
LibVLCSharp is under the LGPLv2.1.