【问题标题】:Play local ismv file with MediaPlayer [closed]使用 MediaPlayer 播放本地 ismv 文件 [关闭]
【发布时间】:2014-06-02 10:58:10
【问题描述】:

每当我尝试播放本地 ismv 文件时,都会收到“System.IO.FileNotFoundException”。这是我的代码

 MediaPlayerLauncher mediaPlayerLauncher = new MediaPlayerLauncher();

 mediaPlayerLauncher.Media = new Uri("To_The_Limit_720_230.ismv", UriKind.Relative);
 mediaPlayerLauncher.Location = MediaLocationType.Data;
 mediaPlayerLauncher.Controls = MediaPlaybackControls.Pause | MediaPlaybackControls.Stop;
 mediaPlayerLauncher.Orientation = MediaPlayerOrientation.Landscape;

 mediaPlayerLauncher.Show();

我在这里做错了什么?

【问题讨论】:

    标签: c# windows windows-phone-8


    【解决方案1】:

    尝试使用UriKind.RelativeOrAbsolute

    mediaPlayerLauncher.Media = new Uri("To_The_Limit_720_230.ismv", UriKind.RelativeOrAbsolute);
    

    添加以下行

    mediaPlayerLauncher.Location = MediaLocationType.Install;
    

    注意:

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

    【讨论】:

    • 感谢 Brainy,仅添加了 Location 属性,我收到错误“抱歉,我们无法在您的手机上播放此文件”。似乎媒体播放器无法播放 ismv 文件。
    • 是的,媒体播放器无法播放ismv 文件。
    • 好的,我还有什么其他选择可以离线下载和播放流畅的流媒体内容
    • 考虑使用Player Framework for Windows Phone 8 smooth streaming applications playerframework.codeplex.com/…
    • 好的,谢谢您的帮助
    【解决方案2】:

    您是否尝试过使用 UriKind.Absolute 并为其提供文件目标的完整路径?

    mediaPlayerLauncher.Media = new Uri(".../.../To_The_Limit_720_230.ismv", UriKind.Absolute);
    

    【讨论】:

      猜你喜欢
      • 2017-10-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多