Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • videolan/LibVLCSharp
  • mfkl/LibVLCSharp
  • dogfive/LibVLCSharp
  • Othmano75/LibVLCSharp
  • GotSoul2017/LibVLCSharp
  • sundramboy93/LibVLCSharp
  • aaqib/LibVLCSharp
  • alanik/LibVLCSharp
  • yfdyh000/LibVLCSharp
  • shevchenko/LibVLCSharp
  • ZeBobo5/LibVLCSharp
  • mhmd_azeez/LibVLCSharp
  • PedroCigaw/LibVLCSharp
  • shawnallen85/LibVLCSharp
  • JohannesKauffmann/LibVLCSharp
  • rururu-orca/LibVLCSharp
  • AndreasReitberger/LibVLCSharp
  • endertasdemir74/LibVLCSharp
  • ramonavaradyova5/LibVLCSharp
  • ibus.hanks/LibVLCSharp
  • huynhsontung/LibVLCSharp
  • mr.oceanchu/LibVLCSharp
  • Vadkarika2/LibVLCSharp
  • ymebrugts/LibVLCSharp
  • berrylcm/LibVLCSharp
  • 1104290011/LibVLCSharp
  • szekelymatyas/LibVLCSharp
  • AperoGame/LibVLCSharp
  • chub/LibVLCSharp
  • AVS42071/LibVLCSharp
  • mosesneto/LibVLCSharp
  • djdwazed/LibVLCSharp
  • alexandre-janniaux/LibVLCSharp
  • jl3053/lib-vlc-sharp
  • hezeping/LibVLCSharp
35 results
Show changes
Commits on Source (120)
Showing
with 244 additions and 55 deletions
custom: https://videolabs.io/solutions/libvlcsharp
\ No newline at end of file
custom: https://videolabs.io/products/libvlcsharp
\ No newline at end of file
......@@ -4,7 +4,7 @@ Please read this!
Before opening a new issue, make sure to search for keywords in the issues
filtered by "bug" label and verify the issue you're about to submit isn't a duplicate.
If you are using LibVLCSharp commercially, please consider purchasing a Commercial License: https://videolabs.io/solutions/libvlcsharp
If you are using LibVLCSharp commercially, please consider purchasing a Commercial License: https://videolabs.io/products/libvlcsharp
If this is a question please ask on StackOverflow: https://stackoverflow.com/questions/tagged/libvlcsharp.
......@@ -21,13 +21,8 @@ Need professional support? Reach out at dotnet@videolabs.io for more info.
Provide a Minimal, Complete, and Verifiable example (https://stackoverflow.com/help/mcve) through a git hosting platform
and post the URL here. Do NOT paste parts of your code in the GitLab issue, share your full (but minimal) code through a git repository.
If you don't provide this, we may not be able to help and may close the issue.
Maintainers should be able to just clone and run your minimal project. If you don't provide this, we may not be able to help and may close the issue.
Please also provide the functional steps to reproduce the behavior (if necessary):
1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error
-->
### What is the current *bug* behavior?
......@@ -41,7 +36,9 @@ Please also provide the functional steps to reproduce the behavior (if necessary
### Does it work on other plaforms? Does it work with the official VLC apps?
<!-- Paste any relevant logs - please use code blocks (```) to format console output,
logs, and code as it's very hard to read otherwise. -->
logs, and code as it's very hard to read otherwise.
If the VLC Windows app (GPL) does not have the issue and you're using the LGPL version of LibVLC in your app, consider this as possible reason for these differences in behavior -->
### Relevant LibVLC logs and/or screenshots
......
......@@ -4,7 +4,7 @@ Please read this!
Before opening a new issue, make sure to search for keywords in the issues
filtered by "feature" label and verify the issue you're about to submit isn't a duplicate.
If you are using LibVLCSharp commercially, please consider purchasing a Commercial License: https://videolabs.io/solutions/libvlcsharp
If you are using LibVLCSharp commercially, please consider purchasing a Commercial License: https://videolabs.io/products/libvlcsharp
If this is a question please ask on StackOverflow: https://stackoverflow.com/questions/tagged/libvlcsharp.
......
......@@ -129,7 +129,7 @@ from the main (upstream) repository:
### Developer Environment
The latest .NET 6 SDK is required.
The latest .NET 8 SDK is required.
- Visual Studio 2022 (with latest patches/updates), with the following workloads/components
- .NET desktop development workload
......
LibVLCSharp version 3.9.3
=========================
* Dependency: Update System.Memory
* Build and docs improvements
* Update Avalonia sample by @jpmikkers
* Core: dispose native mediaplayer instance before freeing gcHandle
* WPF: Make VideoView support zero window height
LibVLCSharp version 3.9.2
=========================
* Avalonia: Fix memory leaks.
* MAUI: Add WinUI support.
* MAUI: Add shell net8.0 target to support adding package to non-shared project solution structures by @jasells
LibVLCSharp version 3.9.1
=========================
* Add macOS and tvOS NET 8 targets
* docs and CI improvements
* MAUI: Add MediaElement support for iOS and Android by @jonx
* Avalonia: Fix VideoView failing to update Content position when shifted by @Odalith
* Avalonia: Add GetVisibleRegionAsGeometry() to clip VideoView.Content to parent window bounds by @Odalith
LibVLCSharp version 3.9.0
=========================
* [BREAKING CHANGE] Uno: Move to Uno 5 support.
* [BREAKING CHANGE] MAUI: Move to .NET 8
* Core: Add support to .NET 8
* CI: Reduce macOS CI scope as it cannot cross-build old/new TFMs easily.
* UWP: use speex for audio resampling
LibVLCSharp version 3.8.5
=========================
* MAUI: Fix broken release by shipping the modern AWindow binding to NuGet.
LibVLCSharp version 3.8.4
=========================
* MAUI: Initial support with simple VideoView for now.
LibVLCSharp version 3.8.3
=========================
* UWP: Fix for opaque subtitle background bug while still allowing optional alpha configuration
* Avalonia: Support UserControl by @taivasverkko
* Avalonia: Child content support for VideoView by @taivasverkko
LibVLCSharp version 3.8.2
=========================
* WPF: ForegroundWindow: Fix regression by @amine2050
LibVLCSharp version 3.8.1
=========================
* WPF: ForegroundWindow: support Viewbox contained and scaled video host by @amine2050
LibVLCSharp version 3.8.0
=========================
* UWP: Added Clear method on VideoView by @FrayxRulez
* UWP: Add alpha support to the SwapChain by @FrayxRulez
* [BREAKING CHANGE] Add support to Avalonia 11. This breaks support to previous versions as Avalonia is not backward compatible.
LibVLCSharp version 3.7.0
=========================
[BREAKING CHANGE] for UWP only: The namespaces of the view has been changed from
```
LibVLCSharp.Platforms.UWP
xmlns:lvs="using:LibVLCSharp.Platforms.UWP"
```
to
```
LibVLCSharp.Platforms.Windows
xmlns:lvs="using:LibVLCSharp.Platforms.Windows"
```
We needed to have a way to name the view for both UWP and WinUI platforms as having 2 separate names was not possible. Hence the API break.
* WinUI: Add initial View integration.
Both Packaged and Unpackaged modes have been tested. For Unpackaged, modify your csproj as the following
<EnablePreviewMsixTooling>false</EnablePreviewMsixTooling>
<WindowsPackageType>None</WindowsPackageType>
<WindowsAppSdkBootstrapInitialize>false</WindowsAppSdkBootstrapInitialize>
<WindowsAppSDKSelfContained>true</WindowsAppSDKSelfContained>
and remove Package.appxmanifest.
The minimal TFM supported for WinUI is net6.0-windows10.0.17763.0.
* UWP: Fix small D3D11 memory leaks in the VideoView.
LibVLCSharp version 3.6.8
=========================
* WPF: Prevent disappear foreground window when closing canceled.
* Linux [NON-API BREAKING CHANGE]: Fix Wayland support by removing automatic X11 threading system initialization (see docs/linux-setup.md)
* Documentation improvements
LibVLCSharp version 3.6.7
=========================
* Updated samples.
* Update .NET and Uno.SourceGenerationTasks SDKs.
* Interop: Fix mediaplayer vmem cleanup callback regression https://code.videolan.org/videolan/LibVLCSharp/-/issues/339
LibVLCSharp version 3.6.6
=========================
* Add support to Eto.Forms UI framework thanks to @rafntor.
* Core: Make Core.Initialize() optional.
* WPF: Add defensive checks around video view detach process.
* WPF: Fix .NET 4.x support.
* WPF: Remove WinForms dependency.
* Documentation improvements.
LibVLCSharp version 3.6.5
=========================
* Fix Xamarin.Forms iOS MediaElement startup regression. https://code.videolan.org/videolan/LibVLCSharp/-/issues/529
......
......@@ -20,6 +20,7 @@ _The official repository URL for this repo is https://code.videolan.org/videolan
- [Preview builds](#Pre-release-versions)
- [Getting started](#getting-started)
- [Documentation](#documentation)
- [Ebook](#ebook)
- [Migrating from Vlc.DotNet](docs/migrating_from_Vlc.DotNet.md)
- [Samples](#samples)
- [Quick API overview](#quick-api-overview)
......@@ -76,13 +77,18 @@ Mono, .NET Framework and .NET Core runtimes are supported.
- Windows Universal (UWP for Desktop, mobile and Xbox)
- Linux including desktop, server and Raspberry Pi (GTK)
- Xamarin.Forms
- Uno Platform (UWP, Android, iOS)
- MAUI
- Uno Platform 5 (WinUI, Android, iOS)
- Avalonia (Windows, macOS, Linux)
- .NET Standard 1.1 and 2.0
- .NET Framework 4.0 and later
- .NET Core (including ASP.NET Core)
- [Unity3D](https://code.videolan.org/videolan/vlc-unity)
- Windows Classic
- Android
- UWP
- iOS
- macOS
## Installation
......@@ -117,6 +123,7 @@ LibVLCSharp is the .NET wrapper that consumes `LibVLC` and allows you to interac
| Xamarin.Mac | [LibVLCSharp](src/LibVLCSharp/README.md) | [![LibVLCSharpBadge]][LibVLCSharp] |
| UWP | [LibVLCSharp](src/LibVLCSharp/README.md) | [![LibVLCSharpBadge]][LibVLCSharp] |
| Xamarin.Forms | [LibVLCSharp.Forms][RLibVLCSharpForms] | [![LibVLCSharpFormsBadge]][LibVLCSharpForms] |
| MAUI | [LibVLCSharp.MAUI][RLibVLCSharpMAUI] | [![LibVLCSharpMAUIBadge]][LibVLCSharpMAUI] |
| WPF | [LibVLCSharp.WPF][RLibVLCSharpWPF] | [![LibVLCSharpWPFBadge]][LibVLCSharpWPF] |
| Xamarin.Forms.WPF | [LibVLCSharp.Forms.WPF][RLibVLCSharpFormsWPF] | [![LibVLCSharpFormsWPFBadge]][LibVLCSharpFormsWPF]|
| GTK | [LibVLCSharp.GTK][RLibVLCSharpGTK] | [![LibVLCSharpGTKBadge]][LibVLCSharpGTK] |
......@@ -124,7 +131,12 @@ LibVLCSharp is the .NET wrapper that consumes `LibVLC` and allows you to interac
| Windows Forms | [LibVLCSharp.WinForms][RLibVLCSharpWinForms] | [![LibVLCSharpWinFormsBadge]][LibVLCSharpWinForms]|
| Uno Platform | [LibVLCSharp.Uno][RLibVLCSharpUno] | [![LibVLCSharpUnoBadge]][LibVLCSharpUno] |
| Avalonia | [LibVLCSharp.Avalonia][RLibVLCSharpAvalonia] | [![LibVLCSharpAvaloniaBadge]][LibVLCSharpAvalonia]|
| Unity3D - Windows | [VLC for Unity (Windows)][RVLCUnityWindows] | [![VLCUnityWindowsBadge]][VLCUnityWindows] |
| Eto.Forms | [LibVLCSharp.Eto][RLibVLCSharpEto] | [![LibVLCSharpEtoBadge]][LibVLCSharpEto] |
| Unity3D - Windows | [VLC for Unity (Windows)][VLCUnityStore] | [![VLCUnityBadge]][VLCUnityStore] |
| Unity3D - UWP | [VLC for Unity (UWP)][VLCUnityStore] | [![VLCUnityBadge]][VLCUnityStore] |
| Unity3D - Android | [VLC for Unity (Android)][VLCUnityStore] | [![VLCUnityBadge]][VLCUnityStore] |
| Unity3D - iOS | [VLC for Unity (iOS)][VLCUnityStore] | [![VLCUnityBadge]][VLCUnityStore] |
| Unity3D - macOS | [VLC for Unity (macOS)][VLCUnityStore] | [![VLCUnityBadge]][VLCUnityStore] |
### Pre-release versions
......@@ -141,6 +153,7 @@ LibVLCSharp 4 preview and LibVLC 4 nightly builds are distributed using https://
See the docs for [preview builds installation details](docs/libvlc_preview.md).
[RLibVLCSharpForms]: src/LibVLCSharp.Forms/README.md
[RLibVLCSharpMAUI]: src/LibVLCSharp.MAUI/README.md
[RLibVLCSharpWPF]: src/LibVLCSharp.WPF/README.md
[RLibVLCSharpFormsWPF]: src/LibVLCSharp.Forms.Platforms.WPF/README.md
[RLibVLCSharpGTK]: src/LibVLCSharp.GTK/README.md
......@@ -148,7 +161,7 @@ See the docs for [preview builds installation details](docs/libvlc_preview.md).
[RLibVLCSharpWinForms]: src/LibVLCSharp.WinForms/README.md
[RLibVLCSharpUno]: src/LibVLCSharp.Uno/README.md
[RLibVLCSharpAvalonia]: src/LibVLCSharp.Avalonia/README.md
[RVLCUnityWindows]: https://assetstore.unity.com/packages/tools/video/vlc-for-unity-windows-133979
[RLibVLCSharpEto]: src/LibVLCSharp.Eto/README.md
[LibVLCWindowsBadge]: https://img.shields.io/nuget/v/VideoLAN.LibVLC.Windows.svg
[LibVLCWindows]: https://www.nuget.org/packages/VideoLAN.LibVLC.Windows/
......@@ -174,6 +187,9 @@ See the docs for [preview builds installation details](docs/libvlc_preview.md).
[LibVLCSharpForms]: https://www.nuget.org/packages/LibVLCSharp.Forms/
[LibVLCSharpFormsBadge]: https://img.shields.io/nuget/v/LibVLCSharp.Forms.svg
[LibVLCSharpMAUI]: https://www.nuget.org/packages/LibVLCSharp.MAUI/
[LibVLCSharpMAUIBadge]: https://img.shields.io/nuget/v/LibVLCSharp.MAUI.svg
[LibVLCSharpWPF]: https://www.nuget.org/packages/LibVLCSharp.WPF/
[LibVLCSharpWPFBadge]: https://img.shields.io/nuget/v/LibVLCSharp.WPF.svg
......@@ -195,8 +211,11 @@ See the docs for [preview builds installation details](docs/libvlc_preview.md).
[LibVLCSharpAvalonia]: https://www.nuget.org/packages/LibVLCSharp.Avalonia/
[LibVLCSharpAvaloniaBadge]: https://img.shields.io/nuget/v/LibVLCSharp.Avalonia.svg
[VLCUnityWindows]: https://assetstore.unity.com/packages/tools/video/vlc-for-unity-windows-133979
[VLCUnityWindowsBadge]: https://img.shields.io/badge/Made%20with-Unity-57b9d3.svg?style=flat&logo=unity
[LibVLCSharpEto]: https://www.nuget.org/packages/LibVLCSharp.Eto/
[LibVLCSharpEtoBadge]: https://img.shields.io/nuget/v/LibVLCSharp.Eto.svg
[VLCUnityStore]: https://videolabs.io/store/unity
[VLCUnityBadge]: https://img.shields.io/badge/Made%20with-Unity-57b9d3.svg?style=flat&logo=unity
## Getting started
......@@ -234,6 +253,12 @@ This page indexes all available tutorial materials about LibVLCSharp. There are
Here we list several interesting projects made by the community using LibVLCSharp. Feel free to send a PR to yours!
## Ebook
In September 2022, the first book ever about LibVLC, the VideoLAN community and LibVLCSharp was released!
[The Good Parts of LibVLC](https://mfkl.gumroad.com/l/libvlc-good-parts) contains everything you need to know about VLC, LibVLC and how to use it from .NET with LibVLCSharp.
## Samples
For more advanced samples, have a look at [libvlcsharp-samples](https://code.videolan.org/mfkl/libvlcsharp-samples) with apps such as:
......@@ -251,9 +276,8 @@ For more advanced samples, have a look at [libvlcsharp-samples](https://code.vid
Feel free to suggest and contribute new samples.
## Quick API overview
```csharp
Core.Initialize();
```csharp
using var libvlc = new LibVLC(enableDebugLogs: true);
using var media = new Media(libvlc, new Uri(@"C:\tmp\big_buck_bunny.mp4"));
using var mediaplayer = new MediaPlayer(media);
......@@ -329,7 +353,7 @@ If you have any question or if you're not sure it's actually an issue, please vi
If you would like VLC developers to provide you with:
- custom development on LibVLC and/or LibVLCSharp,
- training and workshops,
- [commercial licenses](https://videolabs.io/solutions/libvlcsharp),
- [commercial licenses](https://videolabs.io/products/libvlcsharp),
- support services,
- consulting services,
- other multimedia services.
......@@ -342,7 +366,7 @@ Please read and follow the [VideoLAN CoC](https://wiki.videolan.org/Code_of_Cond
## Licenses
LibVLCSharp is released under the [LGPLv2.1](https://tldrlegal.com/license/gnu-lesser-general-public-license-v2.1-(lgpl-2.1)) and is also available under a [commercial license](https://videolabs.io/solutions/libvlcsharp).
LibVLCSharp is released under the [LGPLv2.1](https://tldrlegal.com/license/gnu-lesser-general-public-license-v2.1-(lgpl-2.1)) and is also available under a [commercial license](https://videolabs.io/products/libvlcsharp).
Note: the .NET4.0 LibVLCSharp build references a nuget package that may indicate its license as the .NET Library license but it's actually [opensource](https://github.com/Microsoft/referencesource/commit/6952d2c3923d30a4d88bf57120688b9532bbe1d8) under MIT.
......
......@@ -14,19 +14,19 @@ stages:
jobs:
- job: Linux
pool:
vmImage: 'ubuntu-18.04'
vmImage: 'ubuntu-latest'
steps:
- template: linux-build.yml
- job: macOS
pool:
vmImage: 'macOS-10.15'
vmImage: 'macOS-latest'
steps:
- template: mac-build.yml
- job: Windows
pool:
vmImage: 'windows-2022'
vmImage: 'windows-latest'
steps:
- template: windows-build.yml
......@@ -58,8 +58,17 @@ stages:
- stage: Deploy
dependsOn: Test
condition: and(succeeded('Test'), not(eq(variables['build.reason'], 'PullRequest')))
condition: |
and(
eq(variables['Build.Repository.Name'], 'videolan/libvlcsharp'),
succeeded('Test'),
or(
eq(variables['Build.SourceBranch'], 'refs/heads/master'),
eq(variables['Build.SourceBranch'], 'refs/heads/3.x')
),
ne(variables['Build.Reason'], 'PullRequest'),
ne(variables['Build.Reason'], 'Manual')
)
jobs:
- job: feedz
pool:
......
......@@ -3,13 +3,15 @@ steps:
displayName: 'Use .NET Core SDK'
inputs:
packageType: sdk
version: 6.0.100
version: 8.0.300
- bash: |
dotnet workload install android
dotnet workload install ios
dotnet workload install macos
dotnet workload install tvos
dotnet workload install maui-android
dotnet workload install maui-ios
displayName: 'Install mobile workloads'
condition: ne( variables['Agent.OS'], 'Linux' )
......@@ -18,4 +20,4 @@ steps:
inputs:
command: custom
custom: 'tool'
arguments: 'install cake.tool --global'
\ No newline at end of file
arguments: 'install cake.tool --global'
......@@ -17,7 +17,7 @@ var isCiBuild = BuildSystem.AzurePipelines.IsRunningOnAzurePipelines;
var suffixVersion = $"alpha-{DateTime.Today.ToString("yyyyMMdd")}-{BuildSystem.AzurePipelines.Environment.Build.Id}";
var feedzLVSSource = "https://f.feedz.io/videolan/preview/nuget/index.json";
var FEEDZ = "FEEDZ";
const uint totalPackageCount = 9;
const uint totalPackageCount = 12;
//////////////////////////////////////////////////////////////////////
// PREPARATION
......@@ -48,8 +48,7 @@ Task("Restore-NuGet-Packages")
.IsDependentOn("Clean")
.Does(() =>
{
NuGetRestore(solutionPath);
MoveDirectory("../src/packages", packagesDir);
DotNetRestore(solutionPath);
});
Task("Build")
......@@ -70,12 +69,12 @@ Task("Build-only-libvlcsharp")
Task("Test")
.Does(() =>
{
var settings = new DotNetCoreTestSettings
var settings = new DotNetTestSettings
{
Loggers = new []{ "console;verbosity=detailed" }
};
DotNetCoreTest(testCsproj, settings);
DotNetTest(testCsproj, settings);
});
Task("CIDeploy")
......
steps:
- template: base-template.yml
- task: DotNetCoreCLI@2
displayName: 'Build'
inputs:
command: custom
custom: 'cake'
workingDirectory: buildsystem
\ No newline at end of file
- script: dotnet build src/LibVLCSharp.Mac.sln -c Release
displayName: 'Build solution'
\ No newline at end of file
......@@ -6,7 +6,7 @@ steps:
targetType: 'inline'
script: |
$msiFile = "gtk-sharp-2.12.45.msi"
Invoke-WebRequest "https://xamarin.azureedge.net/GTKforWindows/Windows/$msiFile" -OutFile $msiFile
Invoke-WebRequest "https://github.com/mono/gtk-sharp/releases/download/2.12.45/$msiFile" -OutFile $msiFile
$arguments = "/i `"$msiFile`" /quiet"
Start-Process msiexec.exe -ArgumentList $arguments -Wait
......@@ -17,6 +17,15 @@ steps:
jdkArchitectureOption: 'x64'
jdkSourceOption: 'PreInstalled'
- task: CmdLine@2
inputs:
script: |
echo y | "%ANDROID_HOME%\cmdline-tools\latest\bin\sdkmanager" "platforms;android-27"
echo y | "%ANDROID_HOME%\cmdline-tools\latest\bin\sdkmanager" --licenses
echo y | "%ANDROID_HOME%\cmdline-tools\latest\bin\sdkmanager" "platforms;android-28"
echo y | "%ANDROID_HOME%\cmdline-tools\latest\bin\sdkmanager" --licenses
displayName: 'Install Android SDK'
- task: DotNetCoreCLI@2
displayName: 'Build'
inputs:
......
......@@ -30,6 +30,20 @@ If you need to call back into LibVLCSharp from an event, you need to switch thre
mediaPlayer.EndReached += (sender, args) => ThreadPool.QueueUserWorkItem(_ => mediaPlayer.Play(nextMedia);
```
## Generate a plugin cache (LibVLC.Windows only for now)
If you want `Core.Initialize()` or `new LibVLC()` (if you don't call `Core.Initialize` yourself) to be faster, you could generate a plugins cache (if it is not already there and up to date).
Just run your app once with:
```csharp
new LibVLC("--reset-plugins-cache");
```
This will generate a new `plugins.dat` file in your libvlc plugins folder. LibVLC will use this file to get information on the available plugins in advance, reducing dramatically the loading process.
This file should be updated everytime LibVLC is updated (not LibVLCSharp). We will likely ship it in the LibVLC.Windows NuGet in the future, but you can already generate it yourself by simply using the above code once.
## Check how official VLC apps do it
VLC for iOS and VLC for Android are the biggest libvlc consumer out there. They use libvlc just like anyone using LibVLCSharp uses libvlc to make their app.
......
......@@ -12,7 +12,7 @@ The `MinimalPlayback` one provides a simple approach to getting video on the scr
The steps are:
1. Instantiate a `VideoView` and add it to your main View.
2. Call `Core.Initialize()` to load the `libvlc` native libraries. **This call _must_ be made before creating any libvlcsharp object!**
2. (Optional) Call `Core.Initialize()` to load the `libvlc` native libraries. If you are using LibVLCSharp with the provided LibVLC native nugets, you do not need to make this call yourself (LibVLCSharp handles it for you) but you can. Reasons you'd want to do it yourself, could be to separate the libvlc loading process (which may take a bit of time) and the mediaplayback starting process. Also, if you put your libvlc build in a custom location, you may want to call `Core.Initialize(string path)` yourself with the custom path location.
3. The `VideoView` offers a `MediaPlayer` object (with data-binding support) which you should create and set on the `VideoView`. The `MediaPlayer` allows you to control playback with APIs such as `Play`, `Pause`, set a new media or listen for playback events.
4. In case you are using `LibVLCSharp.Forms`, 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. See the [Forms sample](https://github.com/videolan/libvlcsharp/tree/master/Samples/Forms).
......
......@@ -63,8 +63,6 @@ MediaPlayer.EnableHardwareDecoding = true
Like this, for example:
```csharp
Core.Initialize();
using(var libVLC = new LibVLC())
{
var media = new Media(libVLC, "https://www.youtube.com/watch?v=dQw4w9WgXcQ", FromType.FromLocation);
......@@ -86,8 +84,6 @@ Full list commands and arguments https://wiki.videolan.org/VLC_command-line_help
## How do I set subtitles?
```csharp
Core.Initialize();
using(var libVLC = new LibVLC())
{
var media = new Media(_libVLC, "http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/BigBuckBunny.mp4", FromType.FromLocation);
......@@ -115,7 +111,7 @@ media.AddOption(":freetype-color=16711680"); // Red
## How do I change the subtitle encoding?
```csharp
media.AddOption(":subsdec-encoding=Windows-125");
media.AddOption(":subsdec-encoding=Windows-1252");
```
# How do I change aspect ratio?
......
......@@ -25,5 +25,47 @@ For ubuntu:
## For other platforms
If you are using the *X Window System*, it has to be initialized for multithreading support and this requires you to natively import `libx11`.
If your application doesn't find `libX11.so`, you may need to install the `libx11-dev` package :
> `sudo apt install libx11-dev`
\ No newline at end of file
> `sudo apt install libx11-dev`
Code example:
```c#
using System.Runtime.InteropServices;
namespace myApp;
public static class ImportHelper
{
public struct Native
{
/// <summary>
/// Initializes the X threading system
/// </summary>
/// <remarks>Linux X11 only</remarks>
/// <returns>non-zero on success, zero on failure</returns>
[DllImport("libX11", CallingConvention = CallingConvention.Cdecl)]
public static extern int XInitThreads();
}
}
```
Usage:
```c#
// initialize multithreading support
ImportHelper.Native.XInitThreads();
// player initialization
using var libvlc = new LibVLC(enableDebugLogs: true);
using var media = new Media(libvlc, new Uri(@"C:\tmp\big_buck_bunny.mp4"));
using var mediaplayer = new MediaPlayer(media);
mediaplayer.Play();
Console.ReadKey();
```
\ No newline at end of file
......@@ -57,7 +57,7 @@ Both being based off of the same libvlc APIs, the public C# APIs are quite simil
At the time of writing, both Vlc.DotNet and LibVLCSharp support libvlc 3.x, but only LibVLCSharp has started implementing libvlc 4 features.
For loading LibVLC, unlike with Vlc.DotNet, you may just call `Core.Initialize()`. The path will be found automatically, provided you have installed the LibVLC Windows nuget (see section below).
For loading LibVLC, unlike with Vlc.DotNet, it is done automatically. If you prefer to do it yourself, you may just call `Core.Initialize()`. The path will be found automatically, provided you have installed the LibVLC Windows nuget (see section below), or you can provide it as a string parameter to `Initialize()`.
Short example of API differences
......@@ -128,8 +128,6 @@ namespace ConsoleApp1
{
static async Task Main(string[] args)
{
Core.Initialize();
using var libvlc = new LibVLC();
using var mediaPlayer = new MediaPlayer(libvlc);
......
......@@ -14,7 +14,7 @@ namespace LibVLCSharp.Forms.Sample.MediaPlayerElement.Android
{
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Xamarin.Android.Build.Tasks", "12.1.0.11")]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Xamarin.Android.Build.Tasks", "12.2.0.155")]
public partial class Resource
{
......
......@@ -47,8 +47,6 @@ namespace LibVLCSharp.Forms.Sample.MediaPlayerElement
/// </summary>
public void OnAppearing()
{
Core.Initialize();
LibVLC = new LibVLC(enableDebugLogs: true);
var media = new Media(LibVLC, new Uri("http://streams.videolan.org/streams/mkv/multiple_tracks.mkv"));
......
......@@ -14,7 +14,7 @@ namespace LibVLCSharp.Forms.Sample.Droid
{
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Xamarin.Android.Build.Tasks", "12.1.0.11")]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Xamarin.Android.Build.Tasks", "12.2.0.155")]
public partial class Resource
{
......
......@@ -6,8 +6,8 @@
<PlatformTarget>x86</PlatformTarget>
</PropertyGroup>
<ItemGroup>
<PackageReference Condition="$([MSBuild]::IsOsPlatform('Windows'))" Include="VideoLAN.LibVLC.Windows" Version="3.0.14" />
<PackageReference Condition="$([MSBuild]::IsOsPlatform('OSX'))" Include="VideoLAN.LibVLC.Mac" Version="3.1.2" />
<PackageReference Condition="$([MSBuild]::IsOsPlatform('Windows'))" Include="VideoLAN.LibVLC.Windows" Version="3.0.16" />
<PackageReference Condition="$([MSBuild]::IsOsPlatform('OSX'))" Include="VideoLAN.LibVLC.Mac" Version="3.1.3.1" />
<ProjectReference Include="..\..\..\src\LibVLCSharp.Forms.Platforms.GTK\LibVLCSharp.Forms.Platforms.GTK.csproj" />
<ProjectReference Include="..\LibVLCSharp.Forms.Sample\LibVLCSharp.Forms.Sample.csproj" />
</ItemGroup>
......