VlcVideoPlayer.Avalonia
1.4.0
dotnet add package VlcVideoPlayer.Avalonia --version 1.4.0
NuGet\Install-Package VlcVideoPlayer.Avalonia -Version 1.4.0
<PackageReference Include="VlcVideoPlayer.Avalonia" Version="1.4.0" />
<PackageVersion Include="VlcVideoPlayer.Avalonia" Version="1.4.0" />
<PackageReference Include="VlcVideoPlayer.Avalonia" />
paket add VlcVideoPlayer.Avalonia --version 1.4.0
#r "nuget: VlcVideoPlayer.Avalonia, 1.4.0"
#:package VlcVideoPlayer.Avalonia@1.4.0
#addin nuget:?package=VlcVideoPlayer.Avalonia&version=1.4.0
#tool nuget:?package=VlcVideoPlayer.Avalonia&version=1.4.0
VlcVideoPlayer.Avalonia
A self-contained VLC-based video player control for Avalonia UI with embedded VLC libraries.

Features
- 🎬 Full-featured video player control for Avalonia
- 📦 VLC libraries included automatically - no manual VLC installation required!
- 🎨 Clean, modern UI with Material Design icons
- 🖥️ Cross-platform (Windows, macOS, Linux)
- ⚡ Based on LibVLCSharp for maximum codec support
- 🎛️ Built-in controls: Play/Pause, Stop, Seek bar, Volume slider, Mute
Installation
dotnet add package VlcVideoPlayer.Avalonia
That's it! The VLC native libraries for Windows are automatically included as a transitive dependency. For other platforms, see Platform Support.
Quick Start
Step 1: Add Material Icons to App.axaml
Important: The video player uses Material Icons for its controls. You must add the MaterialIconStyles to your App.axaml:
<Application xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:materialIcons="clr-namespace:Material.Icons.Avalonia;assembly=Material.Icons.Avalonia"
x:Class="YourApp.App">
<Application.Styles>
<FluentTheme />
<materialIcons:MaterialIconStyles />
</Application.Styles>
</Application>
Step 2: Initialize VLC at Startup
In your Program.cs or App.axaml.cs, initialize VLC before creating any windows:
using Avalonia.VlcVideoPlayer;
public class Program
{
public static void Main(string[] args)
{
// Initialize VLC - must be called before creating windows
VlcInitializer.Initialize();
BuildAvaloniaApp().StartWithClassicDesktopLifetime(args);
}
public static AppBuilder BuildAvaloniaApp()
=> AppBuilder.Configure<App>()
.UsePlatformDetect()
.WithInterFont()
.LogToTrace();
}
Step 3: Add the VideoPlayerControl to your Window
<Window xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:vlc="clr-namespace:Avalonia.VlcVideoPlayer;assembly=Avalonia.VlcVideoPlayer"
Title="My Video Player" Width="800" Height="600">
<vlc:VideoPlayerControl x:Name="VideoPlayer" />
</Window>
Step 4: Play a Video
Use the built-in "Open" button, or load programmatically:
// Play a local file
VideoPlayer.Open(@"C:\Videos\movie.mp4");
// Or play from URL
VideoPlayer.OpenUri(new Uri("https://example.com/video.mp4"));
Complete Example
Here's a minimal working example:
MyApp.csproj:
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>WinExe</OutputType>
<TargetFramework>net8.0</TargetFramework>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Avalonia" Version="11.3.6" />
<PackageReference Include="Avalonia.Desktop" Version="11.3.6" />
<PackageReference Include="Avalonia.Themes.Fluent" Version="11.3.6" />
<PackageReference Include="VlcVideoPlayer.Avalonia" Version="1.4.0" />
</ItemGroup>
</Project>
App.axaml:
<Application xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:materialIcons="clr-namespace:Material.Icons.Avalonia;assembly=Material.Icons.Avalonia"
x:Class="MyApp.App">
<Application.Styles>
<FluentTheme />
<materialIcons:MaterialIconStyles />
</Application.Styles>
</Application>
Program.cs:
using Avalonia;
using Avalonia.VlcVideoPlayer;
namespace MyApp;
class Program
{
public static void Main(string[] args)
{
VlcInitializer.Initialize();
BuildAvaloniaApp().StartWithClassicDesktopLifetime(args);
}
public static AppBuilder BuildAvaloniaApp()
=> AppBuilder.Configure<App>()
.UsePlatformDetect()
.LogToTrace();
}
Embedded Player (No Open Button)
For scenarios where you want to play a specific video without the file browser, use the Source property and hide the Open button:
<vlc:VideoPlayerControl
Source="C:\Videos\intro.mp4"
AutoPlay="True"
ShowOpenButton="False"
ControlPanelBackground="#2d2d2d" />
Or set programmatically:
// Hide the Open button and set source
VideoPlayer.ShowOpenButton = false;
VideoPlayer.AutoPlay = true;
VideoPlayer.Source = @"C:\Videos\movie.mp4";
// Customize the control panel background
VideoPlayer.ControlPanelBackground = new SolidColorBrush(Color.Parse("#1a1a1a"));
Custom Control Panel Colors
The control panel background can be customized to match your app's theme:
<vlc:VideoPlayerControl ControlPanelBackground="#1a1a1a" />
<vlc:VideoPlayerControl ControlPanelBackground="{DynamicResource SystemAccentColor}" />
<vlc:VideoPlayerControl ControlPanelBackground="Transparent" />
Platform Support
| Platform | VLC Libraries |
|---|---|
| Windows x64 | ✅ Included via NuGet (VideoLAN.LibVLC.Windows) |
| macOS | 📥 Auto-copies from VLC.app if installed, or prompts to install |
| Linux | 📦 Uses system VLC (sudo apt install vlc libvlc-dev) |
Adding macOS/Linux support to your project
For cross-platform applications, add the appropriate LibVLC packages:
<ItemGroup Condition="$([MSBuild]::IsOSPlatform('OSX'))">
<PackageReference Include="VideoLAN.LibVLC.Mac" Version="3.0.21" />
</ItemGroup>
<ItemGroup Condition="$([MSBuild]::IsOSPlatform('Linux'))">
<PackageReference Include="VideoLAN.LibVLC.Linux" Version="3.0.21" />
</ItemGroup>
API Reference
VideoPlayerControl Properties
| Property | Type | Description |
|---|---|---|
Volume |
int |
Volume level (0-100) |
AutoPlay |
bool |
Auto-play when media is loaded |
ShowControls |
bool |
Show/hide playback controls |
ShowOpenButton |
bool |
Show/hide the Open button (default: true) |
Source |
string |
Video source path - set to auto-load video |
ControlPanelBackground |
IBrush |
Background color of the control panel (default: White) |
IsPlaying |
bool |
Whether media is currently playing |
Position |
double |
Current playback position (0.0-1.0) |
Duration |
TimeSpan |
Total media duration |
VideoPlayerControl Methods
| Method | Description |
|---|---|
Open(string path) |
Open a local file |
OpenUri(Uri uri) |
Open from URL |
Play() |
Start/resume playback |
Pause() |
Pause playback |
Stop() |
Stop playback |
Seek(double position) |
Seek to position (0.0-1.0) |
ToggleMute() |
Toggle audio mute |
VideoPlayerControl Events
| Event | Description |
|---|---|
PlaybackStarted |
Fired when playback starts |
PlaybackPaused |
Fired when playback is paused |
PlaybackStopped |
Fired when playback stops |
MediaEnded |
Fired when media reaches the end |
License
MIT License - see LICENSE for details.
Credits
- LibVLCSharp - VLC bindings for .NET
- Material.Icons.Avalonia - Material Design icons
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net8.0
- Avalonia (>= 11.3.6)
- LibVLCSharp (>= 3.9.4)
- LibVLCSharp.Avalonia (>= 3.9.4)
- Material.Icons.Avalonia (>= 2.4.1)
- VideoLAN.LibVLC.Windows (>= 3.0.21)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.