Windows Phone io.FileNotFoundException

时间:2013-06-26 19:30:07

标签: c# windows-phone-7

我已经指定了视频文件的路径:

VideoPath = string.Format("/Content/Videos/{0}", VideoFileName)

但是当我尝试在MediaPlayerLauncher中调用它时,我得到了FileNotFoundException

  MediaPlayerLauncher mediaPlayerLauncher = new MediaPlayerLauncher();
  mediaPlayerLauncher.Media = new Uri(VideoPath , UriKind.Relative);
  mediaPlayerLauncher.Controls = MediaPlaybackControls.All;

任何解决方案?
谢谢!

1 个答案:

答案 0 :(得分:2)

根据msdn尝试:

mediaPlayerLauncher.Location = MediaLocationType.Data; // If you open media from isolated storage    
// or     
mediaPlayerLauncher.Location = MediaLocationType.Install; // If you open media from application project


mediaPlayerLauncher.Media = new Uri(videoPath , UriKind.Relative);