[英]WP8 error media player can not start
I'm trying to play a small video file in my windows phone application. 我正在尝试在Windows Phone应用程序中播放一个小视频文件。 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();
调试器显示错误在这里:
mediaPlayerLauncher.Show();
That error will be thrown the application can't find your file /Assets/video/video1.wmv
in the install directory on the phone. 应用程序在手机的安装目录中找不到您的文件
/Assets/video/video1.wmv
,将引发该错误。 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).
您也可以打开XAP文件,再次检查它是否位于正确的相对位置(只是重命名的ZIP文件存档)。
如果某些文件具有相同的问题,请仅将文件放在主目录中
mediaPlayerLauncher.Media = new Uri("video1.wmv", UriKind.Relative);
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.