本文介绍了在Windows phone silverlight中播放StorageFile中的视频?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
有没有办法播放保存在图库中的视频(如相机胶卷或视频),由StorageFile访问?
Is there a way to play a video saved in the gallery (like Camera Roll or Videos) that is accessed by StorageFile?
以下代码弹出NotSupportedException:
The following code pops up a NotSupportedException:
var MediaStream = await videoFile[0].OpenStreamForReadAsync();
MediaElement.SetSource(MediaStream);
//play the vid
MediaElement.Play();
推荐答案
using (var isf = IsolatedStorageFile.GetUserStoreForApplication())
{
using (var isfs = new IsolatedStorageFileStream("trailer.wmv", FileMode.Open, isf))
{
this.movie.SetSource(isfs);
}
}
谢谢。
Thanks.
这篇关于在Windows phone silverlight中播放StorageFile中的视频?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!