Reputation: 2623
I'm trying to play a small video file in my windows phone application. Is pretty basic
void StartMediaPlayer()
{
MediaPlayerLauncher mediaPlayerLauncher = new MediaPlayerLauncher();
mediaPlayerLauncher.Media = new Uri("/Assets/video/video1.wmv", UriKind.Relative);
mediaPlayerLauncher.Location = MediaLocationType.Install;
mediaPlayerLauncher.Controls = MediaPlaybackControls.All;
mediaPlayerLauncher.Orientation = MediaPlayerOrientation.Landscape;
mediaPlayerLauncher.Show();
}
i call this void on image tap event, and this is what happend
the debugger show that the error is here: mediaPlayerLauncher.Show();
Upvotes: 2
Views: 461
Reputation: 2623
if some has the same problem, just a heads up the files should be in main directory
mediaPlayerLauncher.Media = new Uri("video1.wmv", UriKind.Relative);
Upvotes: 0
Reputation: 9604
That error will be thrown the application can't find your file /Assets/video/video1.wmv
in the install directory on the phone. Make sure that your video is in your project, and is set to build type "Content". You could open the XAP file to double-check it's in the correct relative location too (it's just a ZIP file archive renamed).
Upvotes: 1