var loadDashjsVideo = function () {
customDataWv = {
"Conax-Custom-Data": cxWidevine.getCxCustomDataForWidevine($scope.loadedContent.token)
};
protectionData = {
"com.widevine.alpha": {
serverURL: widevineLicenseServerUrl,
httpRequestHeaders: customDataWv,
clearkeys: null
}
};
if (!player) {
player = dashjs.MediaPlayer().create();
}
player.setProtectionData(protectionData);
player.initialize(video, null, false);
player.attachSource($scope.loadedContent.link);
player.on(dashjs.MediaPlayer.events['CAN_PLAY'], function() {
player.play();
});
}
This works perfectly fine on Android 5, 6 and 7, tried it on a number of devices. However, it's not working on Android 4.4.2 (tried it on a tablet and a phone).
I'm running the exact same code on these different versions of Android and on 4.4.2 is where the problem occurs. What i can tell from the console log (included below) is that there's a problem when initializing the MediaKeys (which i don't fully understand what they are) and the CAN_PLAY event never gets triggered.
On Android 4.4.2
[78] EME detected on this user agent! (ProtectionModel_21Jan2015)
dash.all.debug.js:2783 [96] [dash.js 2.3.0] MediaPlayer has been initialized
dash.all.debug.js:2783 [104] Playback Initialized
dash.all.debug.js:2783 [2077] Parsing complete: ( xml2json: 1.19e+3ms, objectiron: 280ms, total: 1.47s)
dash.all.debug.js:2783 [2080] Manifest has been refreshed at Tue Oct 25 2016 13:01:36 GMT-0300 (ART)[1477411296.765]
dash.all.debug.js:2783 [2086] SegmentTimeline detected using calculated Live Edge Time
dash.all.debug.js:2783 [2105] MediaSource attached to element. Waiting on open...
dash.all.debug.js:2783 [2190] MediaSource is open!
dash.all.debug.js:2783 [2192] Duration successfully set to: 4945.66675
dash.all.debug.js:2783 [2197] Added 0 inline events
dash.all.debug.js:2783 [2199] video codec: video/mp4;codecs="avc1.4D401E"
dash.all.debug.js:2783 [2285] Schedule controller stopping for video
dash.all.debug.js:2783 [2289] Last saved bitrate for video was 2328
dash.all.debug.js:2783 [2312] audio codec: audio/mp4;codecs="mp4a.40.2"
dash.all.debug.js:2783 [2401] Schedule controller stopping for audio
dash.all.debug.js:2783 [2406] No text data.
dash.all.debug.js:2783 [2407] No fragmentedText data.
dash.all.debug.js:2783 [2409] No embeddedText data.
dash.all.debug.js:2783 [2410] No muxed data.
dash.all.debug.js:2783 [2415] Start Event Controller
dash.all.debug.js:2783 [2422] Schedule controller starting for video
dash.all.debug.js:2783 [2430] Schedule controller starting for audio
dash.all.debug.js:2783 [2617] Init fragment finished loading saving to audio's init cache
dash.all.debug.js:2783 [2627] Init fragment finished loading saving to video's init cache
dash.all.debug.js:2783 [2638] DRM: onNeedKey
dash.all.debug.js:2783 [2640] DRM: initData: 戮pssh 職冒y聵@B聠芦聮忙[脿聢_聲 聻聻 聰<