0
我只有文件Uri才能在MediaElement中打开。 如何使用_MediaElement.SetSource和Uri?我的方法是基于此示例:文件Uri到StorageFile或Stream
var file = await openPicker.PickSingleFileAsync();
var stream = await file.OpenAsync(Windows.Storage.FileAccessMode.Read);
mediaControl.SetSource(stream, file.ContentType);
但是,我只有Uri从文件。有任何想法吗?如果你有一个stream
对象
mediaControl.Source = myUri;
SetSource
是比较合适的:
http://stackoverflow.com/questions/19576394/how-to-play-file-from-library-by-mediaelement – sahap