首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >在隔离存储windows 8.1RT中播放文件.mp3 (StorageFile )与BackgroundMediaPlayer时出错

在隔离存储windows 8.1RT中播放文件.mp3 (StorageFile )与BackgroundMediaPlayer时出错
EN

Stack Overflow用户
提问于 2015-02-06 07:40:51
回答 1查看 501关注 0票数 0

我使用Windows 8.1运行时,我在隔离存储中获得我的歌曲

我的代码: storageFile是孤立存储中的歌曲

代码语言:javascript
复制
IRandomAccessStream stream = await storagefile.OpenAsync(FileAccessMode.Read);
BackgroundMediaPlayer.Current.SetStreamSource(stream);
BackgroundMediaPlayer.Current.Play();

当我播放它,但它不工作,就像照片(试试模拟器和设备lumina 520)

http://photoshare7.com/image/f5a

_message:无法将“Windows.Media.Playback.MediaPlayer”类型的对象转换为“Windows.Media.Playback.IMediaPlayerSource”类型

请帮我.Tks all.Sr我的英语。

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2015-02-23 21:53:21

我遇到了同样的问题:)当您从前台应用程序调用SetStreamSource时会发生这种情况。见[https://msdn.microsoft.com/en-us/library/windows/apps/xaml/dn642090.aspx]。要播放文件中的音频,您需要向后台音频播放器发送消息(请参见[How to pass an object to background project in Windows Phone?)。

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/28360812

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档