I'm trying to play HLS stream in Windows 10 UWP app. This stream contains embedded captions that can be turned on in VLC player or in Edge browser when playing the HLS stream directly.
Is there a way how to show these embedded captions in UWP MediaElement as well?
I've tried using this approach but no textSources are loaded or shown when using these steps:
Uri source = new Uri("http://nasatv-lh.akamaihd.net/i/NASA_101@319270/master.m3u8");
AdaptiveMediaSourceCreationResult result = await AdaptiveMediaSource.CreateFromUriAsync(source);
if (result.Status == AdaptiveMediaSourceCreationStatus.Success)
{
AdaptiveMediaSource astream = result.MediaSource;
MediaSource mediaSource = MediaSource.CreateFromAdaptiveMediaSource(astream);
var metadataTracks = mediaSource.ExternalTimedMetadataTracks.ToArray();
var textSources = mediaSource.ExternalTimedTextSources.ToArray();
// both arrays above are empty when loading the NASA TV stream
MediaPlaybackItem mediaElement = new MediaPlaybackItem(mediaSource);
Player.SetPlaybackSource(mediaElement);
}
Note I've tried to use the Player Framework as well, but with no success.