{"action":"created","comment":{"url":"https://api.github.com/repos/google/shaka-player/pulls/comments/239640923","pull_request_review_id":182481678,"id":239640923,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIzOTY0MDkyMw==","diff_hunk":"@@ -262,6 +262,194 @@ shaka.dash.ContentProtection.parseFromRepresentation = function(\n };\n \n \n+/**\n+ * Gets a Widevine license URL from a content protection element\n+ * containing a custom `ms:laurl` element\n+ *\n+ * @param {shaka.dash.ContentProtection.Element} element\n+ * @return {string}\n+ */\n+shaka.dash.ContentProtection.getWidevineLicenseUrl = function(element) {\n+  const mslaurlNode = shaka.util.XmlUtils.findChildNS(\n+    element.node, 'urn:microsoft', 'laurl');\n+  if (mslaurlNode) {\n+    return mslaurlNode.getAttribute('licenseUrl') || '';\n+  }\n+  return '';\n+};\n+\n+\n+/**\n+ * @typedef {{\n+ *   type: number,\n+ *   value: !Uint8Array\n+ * }}\n+ *\n+ * @description\n+ * The parsed result of a PlayReady object record.\n+ *\n+ * @property {number} type\n+ *   Type of data stored in the record.\n+ * @property {!Uint8Array} value\n+ *   Record content.\n+ */\n+shaka.dash.ContentProtection.PlayReadyRecord;\n+\n+/**\n+ * Enum for PlayReady record types.\n+ * @enum {number}\n+ */\n+shaka.dash.ContentProtection.PLAYREADY_RECORD_TYPES = {\n+  RIGHTS_MANAGEMENT: 0x001,\n+  RESERVED: 0x002,\n+  EMBEDDED_LICENSE: 0x003,\n+};\n+\n+\n+/**\n+ * Parses an Array buffer starting at byteOffset for\n+ * PlayReady Object Records. Each PRO Record is\n+ * preceeded by it's PlayReady Record type and length\n+ * in bytes.\n+ *\n+ * PlayReady Object Record format: https://goo.gl/FTcu46\n+ *\n+ * @param {!ArrayBuffer} recordData\n+ * @param {number} byteOffset\n+ * @return {!Array.<shaka.dash.ContentProtection.PlayReadyRecord>}\n+ * @private\n+ */\n+shaka.dash.ContentProtection.parseMsProRecords_ = function(\n+  recordData, byteOffset) {\n+  const records = [];\n+  const view = new DataView(recordData);\n+\n+  while (byteOffset < recordData.byteLength - 1) {\n+    const type = view.getUint16(byteOffset, true);\n+    byteOffset += 2;\n+\n+    const byteLength = view.getUint16(byteOffset, true);\n+    byteOffset += 2;\n+\n+    goog.asserts.assert(\n+      (byteLength & 1) === 0,\n+      'expected byteLength to be an even number');\n+\n+    // Convert from bytes to WORD length\n+    const begin = byteOffset / 2;\n+    const end = (byteLength + byteOffset) / 2;\n+\n+    // subarray end is exclusive\n+    const recordValue = new Uint16Array(recordData).subarray(begin, end);","path":"lib/dash/content_protection.js","position":82,"original_position":82,"commit_id":"3caf1fff075b2048a9b97aefb0e3745fb225c2ae","original_commit_id":"3caf1fff075b2048a9b97aefb0e3745fb225c2ae","user":{"login":"TheModMaker","id":2141118,"node_id":"MDQ6VXNlcjIxNDExMTg=","avatar_url":"https://avatars2.githubusercontent.com/u/2141118?v=4","gravatar_id":"","url":"https://api.github.com/users/TheModMaker","html_url":"https://github.com/TheModMaker","followers_url":"https://api.github.com/users/TheModMaker/followers","following_url":"https://api.github.com/users/TheModMaker/following{/other_user}","gists_url":"https://api.github.com/users/TheModMaker/gists{/gist_id}","starred_url":"https://api.github.com/users/TheModMaker/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/TheModMaker/subscriptions","organizations_url":"https://api.github.com/users/TheModMaker/orgs","repos_url":"https://api.github.com/users/TheModMaker/repos","events_url":"https://api.github.com/users/TheModMaker/events{/privacy}","received_events_url":"https://api.github.com/users/TheModMaker/received_events","type":"User","site_admin":false},"body":"You can pass the start and end to the `Uint16Array` constructor.","created_at":"2018-12-06T22:36:58Z","updated_at":"2018-12-06T22:52:01Z","html_url":"https://github.com/google/shaka-player/pull/1644#discussion_r239640923","pull_request_url":"https://api.github.com/repos/google/shaka-player/pulls/1644","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/google/shaka-player/pulls/comments/239640923"},"html":{"href":"https://github.com/google/shaka-player/pull/1644#discussion_r239640923"},"pull_request":{"href":"https://api.github.com/repos/google/shaka-player/pulls/1644"}}},"pull_request":{"url":"https://api.github.com/repos/google/shaka-player/pulls/1644","id":226272836,"node_id":"MDExOlB1bGxSZXF1ZXN0MjI2MjcyODM2","html_url":"https://github.com/google/shaka-player/pull/1644","diff_url":"https://github.com/google/shaka-player/pull/1644.diff","patch_url":"https://github.com/google/shaka-player/pull/1644.patch","issue_url":"https://api.github.com/repos/google/shaka-player/issues/1644","number":1644,"state":"open","locked":false,"title":"Add license url parsing","user":{"login":"tylerdaines","id":19310556,"node_id":"MDQ6VXNlcjE5MzEwNTU2","avatar_url":"https://avatars2.githubusercontent.com/u/19310556?v=4","gravatar_id":"","url":"https://api.github.com/users/tylerdaines","html_url":"https://github.com/tylerdaines","followers_url":"https://api.github.com/users/tylerdaines/followers","following_url":"https://api.github.com/users/tylerdaines/following{/other_user}","gists_url":"https://api.github.com/users/tylerdaines/gists{/gist_id}","starred_url":"https://api.github.com/users/tylerdaines/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tylerdaines/subscriptions","organizations_url":"https://api.github.com/users/tylerdaines/orgs","repos_url":"https://api.github.com/users/tylerdaines/repos","events_url":"https://api.github.com/users/tylerdaines/events{/privacy}","received_events_url":"https://api.github.com/users/tylerdaines/received_events","type":"User","site_admin":false},"body":"This PR is based off https://github.com/google/shaka-player/pull/1010.  It closes #484 and parses license urls from `<ms:laurl>` and `<mspr:pro>` in the DASH manifest.  I believe I have addressed all the suggestions made in the original PR.\r\n\r\n/cc @forbesjo","created_at":"2018-10-27T06:09:57Z","updated_at":"2018-12-06T22:52:01Z","closed_at":null,"merged_at":null,"merge_commit_sha":"20c0ec22a74b480e7073422caf52e690d289849f","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[{"id":159144978,"node_id":"MDU6TGFiZWwxNTkxNDQ5Nzg=","url":"https://api.github.com/repos/google/shaka-player/labels/enhancement","name":"enhancement","color":"84b6eb","default":true}],"milestone":null,"commits_url":"https://api.github.com/repos/google/shaka-player/pulls/1644/commits","review_comments_url":"https://api.github.com/repos/google/shaka-player/pulls/1644/comments","review_comment_url":"https://api.github.com/repos/google/shaka-player/pulls/comments{/number}","comments_url":"https://api.github.com/repos/google/shaka-player/issues/1644/comments","statuses_url":"https://api.github.com/repos/google/shaka-player/statuses/3caf1fff075b2048a9b97aefb0e3745fb225c2ae","head":{"label":"Uplynk:parse-license-url","ref":"parse-license-url","sha":"3caf1fff075b2048a9b97aefb0e3745fb225c2ae","user":{"login":"Uplynk","id":8322181,"node_id":"MDEyOk9yZ2FuaXphdGlvbjgzMjIxODE=","avatar_url":"https://avatars3.githubusercontent.com/u/8322181?v=4","gravatar_id":"","url":"https://api.github.com/users/Uplynk","html_url":"https://github.com/Uplynk","followers_url":"https://api.github.com/users/Uplynk/followers","following_url":"https://api.github.com/users/Uplynk/following{/other_user}","gists_url":"https://api.github.com/users/Uplynk/gists{/gist_id}","starred_url":"https://api.github.com/users/Uplynk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Uplynk/subscriptions","organizations_url":"https://api.github.com/users/Uplynk/orgs","repos_url":"https://api.github.com/users/Uplynk/repos","events_url":"https://api.github.com/users/Uplynk/events{/privacy}","received_events_url":"https://api.github.com/users/Uplynk/received_events","type":"Organization","site_admin":false},"repo":{"id":84344201,"node_id":"MDEwOlJlcG9zaXRvcnk4NDM0NDIwMQ==","name":"shaka-player","full_name":"Uplynk/shaka-player","private":false,"owner":{"login":"Uplynk","id":8322181,"node_id":"MDEyOk9yZ2FuaXphdGlvbjgzMjIxODE=","avatar_url":"https://avatars3.githubusercontent.com/u/8322181?v=4","gravatar_id":"","url":"https://api.github.com/users/Uplynk","html_url":"https://github.com/Uplynk","followers_url":"https://api.github.com/users/Uplynk/followers","following_url":"https://api.github.com/users/Uplynk/following{/other_user}","gists_url":"https://api.github.com/users/Uplynk/gists{/gist_id}","starred_url":"https://api.github.com/users/Uplynk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Uplynk/subscriptions","organizations_url":"https://api.github.com/users/Uplynk/orgs","repos_url":"https://api.github.com/users/Uplynk/repos","events_url":"https://api.github.com/users/Uplynk/events{/privacy}","received_events_url":"https://api.github.com/users/Uplynk/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/Uplynk/shaka-player","description":"JavaScript player library / DASH client / MSE-EME player","fork":true,"url":"https://api.github.com/repos/Uplynk/shaka-player","forks_url":"https://api.github.com/repos/Uplynk/shaka-player/forks","keys_url":"https://api.github.com/repos/Uplynk/shaka-player/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Uplynk/shaka-player/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Uplynk/shaka-player/teams","hooks_url":"https://api.github.com/repos/Uplynk/shaka-player/hooks","issue_events_url":"https://api.github.com/repos/Uplynk/shaka-player/issues/events{/number}","events_url":"https://api.github.com/repos/Uplynk/shaka-player/events","assignees_url":"https://api.github.com/repos/Uplynk/shaka-player/assignees{/user}","branches_url":"https://api.github.com/repos/Uplynk/shaka-player/branches{/branch}","tags_url":"https://api.github.com/repos/Uplynk/shaka-player/tags","blobs_url":"https://api.github.com/repos/Uplynk/shaka-player/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Uplynk/shaka-player/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Uplynk/shaka-player/git/refs{/sha}","trees_url":"https://api.github.com/repos/Uplynk/shaka-player/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Uplynk/shaka-player/statuses/{sha}","languages_url":"https://api.github.com/repos/Uplynk/shaka-player/languages","stargazers_url":"https://api.github.com/repos/Uplynk/shaka-player/stargazers","contributors_url":"https://api.github.com/repos/Uplynk/shaka-player/contributors","subscribers_url":"https://api.github.com/repos/Uplynk/shaka-player/subscribers","subscription_url":"https://api.github.com/repos/Uplynk/shaka-player/subscription","commits_url":"https://api.github.com/repos/Uplynk/shaka-player/commits{/sha}","git_commits_url":"https://api.github.com/repos/Uplynk/shaka-player/git/commits{/sha}","comments_url":"https://api.github.com/repos/Uplynk/shaka-player/comments{/number}","issue_comment_url":"https://api.github.com/repos/Uplynk/shaka-player/issues/comments{/number}","contents_url":"https://api.github.com/repos/Uplynk/shaka-player/contents/{+path}","compare_url":"https://api.github.com/repos/Uplynk/shaka-player/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Uplynk/shaka-player/merges","archive_url":"https://api.github.com/repos/Uplynk/shaka-player/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Uplynk/shaka-player/downloads","issues_url":"https://api.github.com/repos/Uplynk/shaka-player/issues{/number}","pulls_url":"https://api.github.com/repos/Uplynk/shaka-player/pulls{/number}","milestones_url":"https://api.github.com/repos/Uplynk/shaka-player/milestones{/number}","notifications_url":"https://api.github.com/repos/Uplynk/shaka-player/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Uplynk/shaka-player/labels{/name}","releases_url":"https://api.github.com/repos/Uplynk/shaka-player/releases{/id}","deployments_url":"https://api.github.com/repos/Uplynk/shaka-player/deployments","created_at":"2017-03-08T16:48:57Z","updated_at":"2018-10-23T21:49:39Z","pushed_at":"2018-12-06T21:50:21Z","git_url":"git://github.com/Uplynk/shaka-player.git","ssh_url":"git@github.com:Uplynk/shaka-player.git","clone_url":"https://github.com/Uplynk/shaka-player.git","svn_url":"https://github.com/Uplynk/shaka-player","homepage":"","size":101976,"stargazers_count":1,"watchers_count":1,"language":"JavaScript","has_issues":false,"has_projects":true,"has_downloads":false,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"forks":0,"open_issues":0,"watchers":1,"default_branch":"master"}},"base":{"label":"google:master","ref":"master","sha":"e464b811e0a2d2a8f7e5039dda3fac0a6ffb56c3","user":{"login":"google","id":1342004,"node_id":"MDEyOk9yZ2FuaXphdGlvbjEzNDIwMDQ=","avatar_url":"https://avatars1.githubusercontent.com/u/1342004?v=4","gravatar_id":"","url":"https://api.github.com/users/google","html_url":"https://github.com/google","followers_url":"https://api.github.com/users/google/followers","following_url":"https://api.github.com/users/google/following{/other_user}","gists_url":"https://api.github.com/users/google/gists{/gist_id}","starred_url":"https://api.github.com/users/google/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/google/subscriptions","organizations_url":"https://api.github.com/users/google/orgs","repos_url":"https://api.github.com/users/google/repos","events_url":"https://api.github.com/users/google/events{/privacy}","received_events_url":"https://api.github.com/users/google/received_events","type":"Organization","site_admin":false},"repo":{"id":28246472,"node_id":"MDEwOlJlcG9zaXRvcnkyODI0NjQ3Mg==","name":"shaka-player","full_name":"google/shaka-player","private":false,"owner":{"login":"google","id":1342004,"node_id":"MDEyOk9yZ2FuaXphdGlvbjEzNDIwMDQ=","avatar_url":"https://avatars1.githubusercontent.com/u/1342004?v=4","gravatar_id":"","url":"https://api.github.com/users/google","html_url":"https://github.com/google","followers_url":"https://api.github.com/users/google/followers","following_url":"https://api.github.com/users/google/following{/other_user}","gists_url":"https://api.github.com/users/google/gists{/gist_id}","starred_url":"https://api.github.com/users/google/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/google/subscriptions","organizations_url":"https://api.github.com/users/google/orgs","repos_url":"https://api.github.com/users/google/repos","events_url":"https://api.github.com/users/google/events{/privacy}","received_events_url":"https://api.github.com/users/google/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/google/shaka-player","description":"JavaScript player library / DASH & HLS client / MSE-EME player","fork":false,"url":"https://api.github.com/repos/google/shaka-player","forks_url":"https://api.github.com/repos/google/shaka-player/forks","keys_url":"https://api.github.com/repos/google/shaka-player/keys{/key_id}","collaborators_url":"https://api.github.com/repos/google/shaka-player/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/google/shaka-player/teams","hooks_url":"https://api.github.com/repos/google/shaka-player/hooks","issue_events_url":"https://api.github.com/repos/google/shaka-player/issues/events{/number}","events_url":"https://api.github.com/repos/google/shaka-player/events","assignees_url":"https://api.github.com/repos/google/shaka-player/assignees{/user}","branches_url":"https://api.github.com/repos/google/shaka-player/branches{/branch}","tags_url":"https://api.github.com/repos/google/shaka-player/tags","blobs_url":"https://api.github.com/repos/google/shaka-player/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/google/shaka-player/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/google/shaka-player/git/refs{/sha}","trees_url":"https://api.github.com/repos/google/shaka-player/git/trees{/sha}","statuses_url":"https://api.github.com/repos/google/shaka-player/statuses/{sha}","languages_url":"https://api.github.com/repos/google/shaka-player/languages","stargazers_url":"https://api.github.com/repos/google/shaka-player/stargazers","contributors_url":"https://api.github.com/repos/google/shaka-player/contributors","subscribers_url":"https://api.github.com/repos/google/shaka-player/subscribers","subscription_url":"https://api.github.com/repos/google/shaka-player/subscription","commits_url":"https://api.github.com/repos/google/shaka-player/commits{/sha}","git_commits_url":"https://api.github.com/repos/google/shaka-player/git/commits{/sha}","comments_url":"https://api.github.com/repos/google/shaka-player/comments{/number}","issue_comment_url":"https://api.github.com/repos/google/shaka-player/issues/comments{/number}","contents_url":"https://api.github.com/repos/google/shaka-player/contents/{+path}","compare_url":"https://api.github.com/repos/google/shaka-player/compare/{base}...{head}","merges_url":"https://api.github.com/repos/google/shaka-player/merges","archive_url":"https://api.github.com/repos/google/shaka-player/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/google/shaka-player/downloads","issues_url":"https://api.github.com/repos/google/shaka-player/issues{/number}","pulls_url":"https://api.github.com/repos/google/shaka-player/pulls{/number}","milestones_url":"https://api.github.com/repos/google/shaka-player/milestones{/number}","notifications_url":"https://api.github.com/repos/google/shaka-player/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/google/shaka-player/labels{/name}","releases_url":"https://api.github.com/repos/google/shaka-player/releases{/id}","deployments_url":"https://api.github.com/repos/google/shaka-player/deployments","created_at":"2014-12-19T21:12:18Z","updated_at":"2018-12-06T22:34:43Z","pushed_at":"2018-12-06T22:34:38Z","git_url":"git://github.com/google/shaka-player.git","ssh_url":"git@github.com:google/shaka-player.git","clone_url":"https://github.com/google/shaka-player.git","svn_url":"https://github.com/google/shaka-player","homepage":"","size":103819,"stargazers_count":2541,"watchers_count":2541,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":false,"has_wiki":false,"has_pages":false,"forks_count":502,"mirror_url":null,"archived":false,"open_issues_count":225,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"forks":502,"open_issues":225,"watchers":2541,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/google/shaka-player/pulls/1644"},"html":{"href":"https://github.com/google/shaka-player/pull/1644"},"issue":{"href":"https://api.github.com/repos/google/shaka-player/issues/1644"},"comments":{"href":"https://api.github.com/repos/google/shaka-player/issues/1644/comments"},"review_comments":{"href":"https://api.github.com/repos/google/shaka-player/pulls/1644/comments"},"review_comment":{"href":"https://api.github.com/repos/google/shaka-player/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/google/shaka-player/pulls/1644/commits"},"statuses":{"href":"https://api.github.com/repos/google/shaka-player/statuses/3caf1fff075b2048a9b97aefb0e3745fb225c2ae"}},"author_association":"NONE"}}
{"actor":{"display_login":"TheModMaker"}}