Problem in using VLC control in WPF

This forum is about all development around libVLC.
SiriusED
New Cone
New Cone
Posts: 2
Joined: 23 Jul 2015 02:38

Problem in using VLC control in WPF

Postby SiriusED » 23 Jul 2015 02:50

Hi, can anyone help me with starting to use VLC control in WPF application?

At the moment I did:
Added references in to my project
Created control in XAML

And here is my code:
###XAML###

Code: Select all

xmlns:pl="clr-namespace:Vlc.DotNet.Wpf;assembly=Vlc.DotNet.Wpf" ... <Border Grid.Row="2" Height="150" Width="Auto" Margin="10,0,10,0" BorderThickness="1" BorderBrush="Red" > <pl:VlcControl x:Name="Player" /> </Border>
###Codebehind###

Code: Select all

public MainWindow() { InitializeComponent(); Player.MediaPlayer.VlcLibDirectoryNeeded += OnVlcControlNeedsLibDirectory; } private void OnVlcControlNeedsLibDirectory(object sender, Vlc.DotNet.Forms.VlcLibDirectoryNeededEventArgs e) { var currentAssembly = Assembly.GetEntryAssembly(); var currentDirectory = new FileInfo(currentAssembly.Location).DirectoryName; if (currentDirectory == null) return; if (AssemblyName.GetAssemblyName(currentAssembly.Location).ProcessorArchitecture == ProcessorArchitecture.X86) e.VlcLibDirectory = new DirectoryInfo(System.IO.Path.Combine(currentDirectory, @"vlslib\x86\")); else e.VlcLibDirectory = new DirectoryInfo(System.IO.Path.Combine(currentDirectory, @"vlslib\x64\")); } private void StartButton_Click(object sender, RoutedEventArgs e) { var d = new Microsoft.Win32.OpenFileDialog(); d.Multiselect = false; if (d.ShowDialog() == true) { Uri src = new Uri(d.FileName); Player.Visibility = System.Windows.Visibility.Visible; Player.MediaPlayer.Play(src); } }
Looks like good, bud I can't see the video... I hear only the sound from video, player shows me just nothing... What I do wrong?

SiriusED
New Cone
New Cone
Posts: 2
Joined: 23 Jul 2015 02:38

Re: Problem in using VLC control in WPF

Postby SiriusED » 23 Jul 2015 23:26

I found a problem, the problem in `AllowTransparency` property of window where located my VlcControl... Is this a bug or what? How can I use `AllowTransparency` on main window and VlcControl togather?


Return to “Development around libVLC”

Who is online

Users browsing this forum: No registered users and 20 guests