Problem with XLINK resolution in 1.5 / nightly build
Created by: nmsguru
This used to work in 1.4 but is failing in 1.5/nightly build. I have a manifest with multiple Periods taken from the DASH-IF test vectors. I added an XLINK into one of the Period. The XLINK resolve to a new Period to replace the original Period.
In nightly build, this fails with "Uncaught TypeError: Cannot read property 'Date' of undefined". When I use the chrome debugger I see the following stack trace: getLatestMPDRequestHeaderValueByID @ DashMetricsExtensions.js:339 checkForDateHeader @ TimeSyncController.js:224 onComplete @ TimeSyncController.js:265 attemptSync @ TimeSyncController.js:307 initialize @ TimeSyncController.js:326 onManifestUpdated @ StreamController.js:441 dijon.System.notify @ dijon.js:599 notify @ Notifier.js:67 update @ ManifestUpdater.js:68 onManifestLoaded @ ManifestUpdater.js:97 dijon.System.notify @ dijon.js:599 notify @ Notifier.js:67 onXlinkReady @ ManifestLoader.js:158 dijon.System.notify @ dijon.js:599 notify @ Notifier.js:67 onXlinkAllElementsLoaded @ XlinkController.js:128 resolve @ XlinkController.js:67 onXlinkAllElementsLoaded @ XlinkController.js:124 onXlinkElementLoaded @ XlinkController.js:98 dijon.System.notify @ dijon.js:599 notify @ Notifier.js:67 onload @ XlinkLoader.js:72
The code near the offending line in DashMetricsExtensions.js is: getLatestMPDRequestHeaderValueByID = function(metrics, id) {
if (metrics === null) return null;
var httpRequestList = getHttpRequests(metrics),
httpRequest = httpRequestList[httpRequestList.length-1],
headers;
if (httpRequest.type === MediaPlayer.vo.metrics.HTTPRequest.MPD_TYPE) {
headers = parseResponseHeaders(httpRequest.responseHeaders);
}
return headers[id] === undefined ? null : headers[id]; <<<<---failing here
}
At the point of failure headers is actually NULL. headers is set above ONLY if the httpRequest.type is MPD_TYPE but it is not - at this point httpRequest.type is actually "Xlink Expansion".
I'm not sure what the fix would be since I'm not familiar enough with the call flow but it seems that at the point the code is here it is evaluating an xlink period list not an MPD?