我使用Windows 8.1运行时,我在隔离存储中获得我的歌曲
我的代码: storageFile是孤立存储中的歌曲
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我的英语。
发布于 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?)。
https://stackoverflow.com/questions/28360812
复制相似问题