Alex
Alex

Reputation: 294

Windows Phone io.FileNotFoundException

I've specified the path to video file like this:

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

But when I try to invoke it in MediaPlayerLauncher I get FileNotFoundException

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

Any solution?
Thanks!

Upvotes: 0

Views: 144

Answers (1)

YD1m
YD1m

Reputation: 5895

According msdn try that:

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);

Upvotes: 2

Related Questions