{"action":"created","issue":{"url":"https://api.github.com/repos/Dash-Industry-Forum/dash.js/issues/966","labels_url":"https://api.github.com/repos/Dash-Industry-Forum/dash.js/issues/966/labels{/name}","comments_url":"https://api.github.com/repos/Dash-Industry-Forum/dash.js/issues/966/comments","events_url":"https://api.github.com/repos/Dash-Industry-Forum/dash.js/issues/966/events","html_url":"https://github.com/Dash-Industry-Forum/dash.js/issues/966","id":124233063,"number":966,"title":"Can't play Widevine content on Chromecast devices","user":{"login":"Jukurrpa","id":341072,"avatar_url":"https://avatars.githubusercontent.com/u/341072?v=3","gravatar_id":"","url":"https://api.github.com/users/Jukurrpa","html_url":"https://github.com/Jukurrpa","followers_url":"https://api.github.com/users/Jukurrpa/followers","following_url":"https://api.github.com/users/Jukurrpa/following{/other_user}","gists_url":"https://api.github.com/users/Jukurrpa/gists{/gist_id}","starred_url":"https://api.github.com/users/Jukurrpa/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Jukurrpa/subscriptions","organizations_url":"https://api.github.com/users/Jukurrpa/orgs","repos_url":"https://api.github.com/users/Jukurrpa/repos","events_url":"https://api.github.com/users/Jukurrpa/events{/privacy}","received_events_url":"https://api.github.com/users/Jukurrpa/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-12-29T16:14:20Z","updated_at":"2016-01-05T09:08:06Z","closed_at":null,"body":"I'm trying to play MPEG-Dash + Widevine video on a Chromecast receiver and have an issue getting the `MediaPlayer` to retrieve the license.\r\n\r\nEverything works well when I use the receiver on Chrome (and simulate a Chromecast load command), but for some reason when used on a Chromecast device or a Nexus Player, the `ProtectionController` seems to be attempting to use PlayReady DRM instead.\r\n\r\nHere's the log on Chrome (successful playback):\r\n> [292][protectionController] KeySystem Access Granted (com.widevine.alpha)!  Selecting key system... \r\n> [300][protectionController] KeySystem Access Granted \r\n> [300][protectionController] Ignoring initData because we have already seen it! \r\n> [342][protectionController] DRM: Session created.  SessionID = ...\r\n\r\nAnd the log on Chromecast devices:\r\n> [1352][protectionController] KeySystem Access Granted (com.microsoft.playready)!  Selecting key system... \r\n> [1356][stream] DRM: Error selecting key system! -- Error selecting keys system (com.microsoft.playready)! Could not create MediaKeys -- TODO\r\n\r\nThe very same code is being used in both cases. Here's how the `MediaPlayer` is initialized and the video requested:\r\n\r\n```javascript\r\n// initialization\r\nvideo = document.querySelector(\".dash-video-player video\");\r\ncontext = new Dash.di.DashContext();\r\nplayer = new MediaPlayer(context);\r\nplayer.startup();\r\nplayer.attachView(video);\r\n```\r\n\r\n```javascript\r\n// play callback\r\nvar protData = {\r\n    \"com.widevine.alpha\": {\r\n        \"drmtoday\": true,\r\n        \"serverURL\": \"https://lic.drmtoday.com/license-proxy-widevine/cenc/\",\r\n        \"httpRequestHeaders\": {\r\n            \"x-dt-auth-token\": asset.drm.token\r\n        }\r\n    }\r\n};\r\n\r\nplayer.attachSource(asset.url, null, protData);\r\n```\r\n\r\nP.S: I posted this on Stackoverflow, but it actually seems to be a Dash.js issue, so I'm posting it here too. Sorry if it's not."},"comment":{"url":"https://api.github.com/repos/Dash-Industry-Forum/dash.js/issues/comments/168939966","html_url":"https://github.com/Dash-Industry-Forum/dash.js/issues/966#issuecomment-168939966","issue_url":"https://api.github.com/repos/Dash-Industry-Forum/dash.js/issues/966","id":168939966,"user":{"login":"bwidtmann","id":5071747,"avatar_url":"https://avatars.githubusercontent.com/u/5071747?v=3","gravatar_id":"","url":"https://api.github.com/users/bwidtmann","html_url":"https://github.com/bwidtmann","followers_url":"https://api.github.com/users/bwidtmann/followers","following_url":"https://api.github.com/users/bwidtmann/following{/other_user}","gists_url":"https://api.github.com/users/bwidtmann/gists{/gist_id}","starred_url":"https://api.github.com/users/bwidtmann/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bwidtmann/subscriptions","organizations_url":"https://api.github.com/users/bwidtmann/orgs","repos_url":"https://api.github.com/users/bwidtmann/repos","events_url":"https://api.github.com/users/bwidtmann/events{/privacy}","received_events_url":"https://api.github.com/users/bwidtmann/received_events","type":"User","site_admin":false},"created_at":"2016-01-05T09:08:06Z","updated_at":"2016-01-05T09:08:06Z","body":"the reason for this is that the chromecast receiver browser has both CDMs available (Widevine and Playready). dash.js takes the first one that is available for key system selection. If you change the order of setting up the key systems in ProtectionExtension.js in Line 60, it should work. "}}