{"action":"created","issue":{"url":"https://api.github.com/repos/Dash-Industry-Forum/dash.js/issues/721","labels_url":"https://api.github.com/repos/Dash-Industry-Forum/dash.js/issues/721/labels{/name}","comments_url":"https://api.github.com/repos/Dash-Industry-Forum/dash.js/issues/721/comments","events_url":"https://api.github.com/repos/Dash-Industry-Forum/dash.js/issues/721/events","html_url":"https://github.com/Dash-Industry-Forum/dash.js/issues/721","id":103361460,"number":721,"title":"Problem with XLINK resolution in 1.5 / nightly build","user":{"login":"nmsguru","id":13987766,"avatar_url":"https://avatars.githubusercontent.com/u/13987766?v=3","gravatar_id":"","url":"https://api.github.com/users/nmsguru","html_url":"https://github.com/nmsguru","followers_url":"https://api.github.com/users/nmsguru/followers","following_url":"https://api.github.com/users/nmsguru/following{/other_user}","gists_url":"https://api.github.com/users/nmsguru/gists{/gist_id}","starred_url":"https://api.github.com/users/nmsguru/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nmsguru/subscriptions","organizations_url":"https://api.github.com/users/nmsguru/orgs","repos_url":"https://api.github.com/users/nmsguru/repos","events_url":"https://api.github.com/users/nmsguru/events{/privacy}","received_events_url":"https://api.github.com/users/nmsguru/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":6,"created_at":"2015-08-26T20:52:51Z","updated_at":"2015-08-27T07:46:07Z","closed_at":null,"body":"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.\r\n\r\nIn 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:\r\ngetLatestMPDRequestHeaderValueByID\t@\tDashMetricsExtensions.js:339\r\ncheckForDateHeader\t@\tTimeSyncController.js:224\r\nonComplete\t@\tTimeSyncController.js:265\r\nattemptSync\t@\tTimeSyncController.js:307\r\ninitialize\t@\tTimeSyncController.js:326\r\nonManifestUpdated\t@\tStreamController.js:441\r\ndijon.System.notify\t@\tdijon.js:599\r\nnotify\t@\tNotifier.js:67\r\nupdate\t@\tManifestUpdater.js:68\r\nonManifestLoaded\t@\tManifestUpdater.js:97\r\ndijon.System.notify\t@\tdijon.js:599\r\nnotify\t@\tNotifier.js:67\r\nonXlinkReady\t@\tManifestLoader.js:158\r\ndijon.System.notify\t@\tdijon.js:599\r\nnotify\t@\tNotifier.js:67\r\nonXlinkAllElementsLoaded\t@\tXlinkController.js:128\r\nresolve\t@\tXlinkController.js:67\r\nonXlinkAllElementsLoaded\t@\tXlinkController.js:124\r\nonXlinkElementLoaded\t@\tXlinkController.js:98\r\ndijon.System.notify\t@\tdijon.js:599\r\nnotify\t@\tNotifier.js:67\r\nonload\t@\tXlinkLoader.js:72\r\n\r\nThe code near the offending line in DashMetricsExtensions.js is:\r\ngetLatestMPDRequestHeaderValueByID = function(metrics, id) {\r\n\r\n            if (metrics === null) return null;\r\n            var httpRequestList = getHttpRequests(metrics),\r\n                httpRequest = httpRequestList[httpRequestList.length-1],\r\n                headers;\r\n\r\n            if (httpRequest.type === MediaPlayer.vo.metrics.HTTPRequest.MPD_TYPE) {\r\n                headers = parseResponseHeaders(httpRequest.responseHeaders);\r\n            }\r\n\r\n            return headers[id] === undefined ? null :  headers[id]; <<<<---failing here\r\n        }\r\n\r\nAt 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\".\r\n\r\nI'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?"},"comment":{"url":"https://api.github.com/repos/Dash-Industry-Forum/dash.js/issues/comments/135324382","html_url":"https://github.com/Dash-Industry-Forum/dash.js/issues/721#issuecomment-135324382","issue_url":"https://api.github.com/repos/Dash-Industry-Forum/dash.js/issues/721","id":135324382,"user":{"login":"bbcrddave","id":5390145,"avatar_url":"https://avatars.githubusercontent.com/u/5390145?v=3","gravatar_id":"","url":"https://api.github.com/users/bbcrddave","html_url":"https://github.com/bbcrddave","followers_url":"https://api.github.com/users/bbcrddave/followers","following_url":"https://api.github.com/users/bbcrddave/following{/other_user}","gists_url":"https://api.github.com/users/bbcrddave/gists{/gist_id}","starred_url":"https://api.github.com/users/bbcrddave/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bbcrddave/subscriptions","organizations_url":"https://api.github.com/users/bbcrddave/orgs","repos_url":"https://api.github.com/users/bbcrddave/repos","events_url":"https://api.github.com/users/bbcrddave/events{/privacy}","received_events_url":"https://api.github.com/users/bbcrddave/received_events","type":"User","site_admin":false},"created_at":"2015-08-27T07:46:07Z","updated_at":"2015-08-27T07:46:07Z","body":"Patch b943d25 should fix the immediate issue.\r\n\r\nOn a side note, if the relevant CORS headers are not set, you can't get the Date header anyway [1].\r\n\r\n[1] http://www.w3.org/TR/cors/#handling-a-response-to-a-cross-origin-request"}}