0

I want to play videos in VlcControl from my Assembly resources. I have a code:

 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.MediaPlayer.Play(src);
     }
 }

How to change that worked with resource files, like code below:

 private void StartButton_Click(object sender, RoutedEventArgs e)
 {
    // Change file Uri to resource Uri HERE!!!
    Uri src = new Uri(@"pack://application:,,,/MyAssemblyName;component/media/myVideo.mp4");
    Player.MediaPlayer.Play(src);
 }

Or create Media type from ResourceStream or any other way to achieve result... Tnx.

SkyDancer
  • 129
  • 1
  • 4
  • 13

0 Answers0