We do use MediaPlayerElement in UWP to play videos. However, occasionally (the occurance seems to be rare), the video which is working normally in any other way fails with following exception:
A valid type has not been set for this stream or a stream that it dependes on. (Exception from HRESULT
0xC00D6D60)
What can cause this exception in our case? How to prevent it?
Edit - added snippet according to RoyLi comment:
This is how we create MediaPlaybackItem.
StorageFile manifest_file = await Storage.MovieManifestFile(mi.UserGUID, mi.OrderItemGUID);
amscr = await AdaptiveMediaSource.CreateFromStreamAsync(await manifest_file.OpenReadAsync(), new Uri(mi.MPDManifestUrl), "application/dash+xml");
MediaSource converted_amscr = MediaSource.CreateFromAdaptiveMediaSource(amscr.MediaSource);
MediaPlaybackItem ampi = new MediaPlaybackItem(converted_amscr);
The video source is MPEG-DASH stream protected with PlayReady. The issue was reproduced only on some devices and it happened not just for MPEG-DASH, but also for PIFF files.
After creating the MediaPlaybackItem, we simply use it as source for MediaPlayerElement.
me.MediaPlayer.Source = ampi;
me.MediaPlayer.Play();
User contributions licensed under CC BY-SA 3.0