mediaelement - How to display embedded Closed Captions for HLS stream in Windows 10 UWP app? -


i'm trying play hls stream in windows 10 uwp app. this stream contains embedded captions can turned on in vlc player or in edge browser when playing hls stream directly.

is there way how show these embedded captions in uwp mediaelement well?

i've tried using approach no textsources 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 empty when loading nasa tv stream      mediaplaybackitem mediaelement = new mediaplaybackitem(mediasource);     player.setplaybacksource(mediaelement); } 

note i've tried use player framework well, no success.

how show these embedded captions in uwp mediaelement?

to show embedded captions in this stream, can set uri mediaelement's source , change aretransportcontrolsenabled property true enable standard transport controls.

<mediaelement x:name="mediaelement"               aretransportcontrolsenabled="true"               source="http://nasatv-lh.akamaihd.net/i/nasa_101@319270/master.m3u8" /> 

once has valid captions, closed caption menu show , can use control whether display closed captions following:
enter image description here

mediasource.externaltimedmetadatatracks , mediasource.externaltimedtextsources property used external timed metadata tracks or text sources associated mediasource. captions in stream embedded , didn't add timedtextsource in externaltimedtextsources there no textsources.


Comments

Popular posts from this blog

wordpress - (T_ENDFOREACH) php error -

Export Excel workseet into txt file using vba - (text and numbers with formulas) -

Using django-mptt to get only the categories that have items -