Commit e6694dda authored by Martin Finkel's avatar Martin Finkel

update README

(cherry picked from commit 3342fb6e4bcddf6dd554e6aa8c31be7309dc578d)
parent 8b506e5e
......@@ -29,21 +29,38 @@ 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](https://github.com/mfkl/libvlc-nuget).
The second package you need is LibVLCSharp, the .NET wrapper that consumes `libvlc` and allows you to interact with native code from C#/F#. Get it from NuGet: https://www.nuget.org/packages/LibVLCSharp.
The second package you need is LibVLCSharp, the .NET wrapper that consumes `libvlc` and allows you to interact with native code from C#/F#.
```cmd
dotnet add package LibVLCSharp --version 0.0.1-alpha2
```
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).
```cmd
dotnet add package LibVLCSharp.Forms --version 0.0.1-alpha
```
https://www.nuget.org/packages/LibVLCSharp.Forms/
## Getting started
Feel free to check out the sample projects for [iOS](https://github.com/mfkl/LibVLCSharp/blob/master/LibVLCSharp.iOS.Sample/ViewController.cs) and [Android](https://github.com/mfkl/LibVLCSharp/blob/master/LibVLCSharp.Android.Sample/MainActivity.cs) to get started.
Feel free to check out the native sample projects for [iOS](https://github.com/mfkl/LibVLCSharp/blob/master/LibVLCSharp.iOS.Sample/ViewController.cs) and [Android](https://github.com/mfkl/LibVLCSharp/blob/master/LibVLCSharp.Android.Sample/MainActivity.cs) 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](https://www.videolan.org/developers/vlc/doc/doxygen/html/group__libvlc.html) which this wrapper follows closely.
Regarding LibVLCSharp.Forms, check out the sample for [Forms](https://github.com/mfkl/LibVLCSharp/tree/master/LibVLCSharp.Forms.Sample) to get started.
Notably, make sure to call `LibVLCSharpFormsRenderer.Init()` in your platform specific project [*before*](https://forums.xamarin.com/discussion/comment/57605/#Comment_57605) `Xamarin.Forms.Forms.Init` is called.
### Quick overview
- `VideoView.cs`: Custom view which holds an `Instance` and a `MediaPlayer`.
- [`Instance.cs`](https://github.com/mfkl/LibVLCSharp/blob/master/LibVLCSharp/Shared/Instance.cs): Main object pointing to a native `libvlc` instance in native code. Most other objects are related to this (in case you have multiple players in one app, for example). Accessible from `VideoView`.
- [`MediaPlayer.cs`](https://github.com/mfkl/LibVLCSharp/blob/master/LibVLCSharp/Shared/MediaPlayer.cs): Manages playback, offers event listeners and more.
- `VideoView.cs`: Custom view which holds a `LibVLC` object and a `MediaPlayer` object.
- [`LibVLC.cs`](https://github.com/mfkl/LibVLCSharp/blob/master/LibVLCSharp/Shared/LibVLC.cs): Main object pointing to a native `libvlc` instance in native code. Accessible from `VideoView`.
- [`MediaPlayer.cs`](https://github.com/mfkl/LibVLCSharp/blob/master/LibVLCSharp/Shared/MediaPlayer.cs): Manages playback, offers event listeners and more. Accessible from `VideoView`.
- [`MediaDiscoverer.cs`](https://github.com/mfkl/LibVLCSharp/blob/master/LibVLCSharp/Shared/MediaDiscoverer.cs): This object should be used to find media on NAS and any SMB/UPnP-enabled device on your local network.
- [`RendererDiscoverer.cs`](https://github.com/mfkl/LibVLCSharp/blob/master/LibVLCSharp/Shared/RendererDiscoverer.cs): Use this to find and use a Chromecast or other distant renderers.
- [`Media.cs`](https://github.com/mfkl/LibVLCSharp/blob/master/LibVLCSharp/Shared/Media.cs): Class representing and providing information about a media such as a video or audio file or stream.
......@@ -59,6 +76,6 @@ For usage of the API, you should check out the `libvlc` [C API documentation](ht
- Linux (GTK)
- UWP
- Tizen
- Unity
- Game engines (Unity, Unreal, Godot)
All contributions are welcome.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment