我想从我的程序集资源中播放VlcControl
中的视频。我有一个代码:
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);
}
}
如何更改资源文件,如下面的代码:
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);
}
或者从Media
创建ResourceStream
类型或以任何其他方式获得结果... Tnx。