I have an issue with MediaElement
in my Win8 app - when I try to play some ".wmv" files from local library it very often (not always) throws MediaFailed
and I get the error
MF_MEDIA_ENGINE_ERR_SRC_NOT_SUPPORTED : HRESULT - 0xC00D36C4
which means
Either the video codec or the audio codec is unsupported, or one of
the streams in a video file is corrupted. This content may not be
supported.
The problem is not that files are corrupted (I can play them with Windows Media Player). Here's the code I use to set MediaElement
:
private async void Button_Click(object sender, RoutedEventArgs e)
{
var picker = new FileOpenPicker();
picker.FileTypeFilter.Add(".wmv");
picker.FileTypeFilter.Add(".mp4");
picker.SuggestedStartLocation = PickerLocationId.VideosLibrary;
StorageFile file = await picker.PickSingleFileAsync();
if (file != null)
{
using (IRandomAccessStream ras = await file.OpenAsync(FileAccessMode.Read))
{
me.SetSource(ras, file.ContentType);
}
}
}
Does anybody know what's wrong here? Thanks in advance.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…