{"action":"created","comment":{"url":"https://api.github.com/repos/chemoish/videojs-fairplay/pulls/comments/73640613","id":73640613,"diff_hunk":"@@ -0,0 +1,239 @@\n+/* global videojs, WebKitMediaKeys */\n+\n+import * as util from './util';\n+import concatInitDataIdAndCertificate from './fairplay';\n+\n+const {\n+  arrayToString,\n+  getHostnameFromURI,\n+} = util;\n+\n+let logToBrowserConsole = false;\n+\n+class Html5Fairplay {\n+  constructor(source, tech, options) {\n+    options = options || tech.options_;\n+\n+    if (!source.src) {\n+      return;\n+    }\n+\n+    this.el_ = tech.el();\n+    this.player_ = videojs(options.playerId);\n+    this.protection_ = source && source.protection;\n+    this.tech_ = tech;\n+\n+    this.onCertificateError = this.onCertificateError.bind(this);\n+    this.onCertificateLoad = this.onCertificateLoad.bind(this);\n+    this.onKeySessionWebkitKeyAdded = this.onKeySessionWebkitKeyAdded.bind(this);\n+    this.onKeySessionWebkitKeyError = this.onKeySessionWebkitKeyError.bind(this);\n+    this.onKeySessionWebkitKeyMessage = this.onKeySessionWebkitKeyMessage.bind(this);\n+    this.onLicenseError = this.onLicenseError.bind(this);\n+    this.onLicenseLoad = this.onLicenseLoad.bind(this);\n+    this.onVideoError = this.onVideoError.bind(this);\n+    this.onVideoWebkitNeedKey = this.onVideoWebkitNeedKey.bind(this);\n+\n+    tech.isReady_ = false;\n+\n+    this.src(source);\n+\n+    tech.triggerReady();\n+  }\n+\n+  createKeySession(keySystem, initData) {\n+    if (!this.el_.webkitKeys) {\n+      if (WebKitMediaKeys.isTypeSupported(keySystem, 'video/mp4')) {\n+        this.el_.webkitSetMediaKeys(new WebKitMediaKeys(keySystem));\n+      } else {\n+        throw new Error('Key System not supported');\n+      }\n+    }\n+\n+    if (!this.el_.webkitKeys) {\n+      throw new Error('Could not create MediaKeys');\n+    }\n+\n+    const keySession = this.el_.webkitKeys.createSession('video/mp4', initData);\n+\n+    if (!keySession) {\n+      throw new Error('Could not create key session');\n+    }\n+\n+    return keySession;\n+  }\n+\n+  fetchCertificate({ callback }) {\n+    const { certificateUrl } = this.protection_;\n+\n+    const request = new XMLHttpRequest();\n+\n+    request.responseType = 'arraybuffer';\n+\n+    request.addEventListener('error', this.onCertificateError, false);\n+    request.addEventListener('load', (event) => {\n+      this.onCertificateLoad(event, {\n+        callback,\n+      });\n+    }, false);\n+\n+    request.open('GET', certificateUrl, true);\n+    request.send();\n+  }\n+\n+  fetchLicense({ target, message }) {","path":"src/videojs-fairplay.js","position":83,"original_position":83,"commit_id":"e1f5d4938dec177658cee4f4d96f870090642d13","original_commit_id":"e1f5d4938dec177658cee4f4d96f870090642d13","user":{"login":"m14t","id":207950,"avatar_url":"https://avatars.githubusercontent.com/u/207950?v=3","gravatar_id":"","url":"https://api.github.com/users/m14t","html_url":"https://github.com/m14t","followers_url":"https://api.github.com/users/m14t/followers","following_url":"https://api.github.com/users/m14t/following{/other_user}","gists_url":"https://api.github.com/users/m14t/gists{/gist_id}","starred_url":"https://api.github.com/users/m14t/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/m14t/subscriptions","organizations_url":"https://api.github.com/users/m14t/orgs","repos_url":"https://api.github.com/users/m14t/repos","events_url":"https://api.github.com/users/m14t/events{/privacy}","received_events_url":"https://api.github.com/users/m14t/received_events","type":"User","site_admin":false},"body":"Is there a reason to make `fetchLicense` take a single object with two properties, instead of just 2 parameters?","created_at":"2016-08-05T04:28:56Z","updated_at":"2016-08-05T04:28:56Z","html_url":"https://github.com/chemoish/videojs-fairplay/pull/1#discussion_r73640613","pull_request_url":"https://api.github.com/repos/chemoish/videojs-fairplay/pulls/1","_links":{"self":{"href":"https://api.github.com/repos/chemoish/videojs-fairplay/pulls/comments/73640613"},"html":{"href":"https://github.com/chemoish/videojs-fairplay/pull/1#discussion_r73640613"},"pull_request":{"href":"https://api.github.com/repos/chemoish/videojs-fairplay/pulls/1"}}},"pull_request":{"url":"https://api.github.com/repos/chemoish/videojs-fairplay/pulls/1","id":80183054,"html_url":"https://github.com/chemoish/videojs-fairplay/pull/1","diff_url":"https://github.com/chemoish/videojs-fairplay/pull/1.diff","patch_url":"https://github.com/chemoish/videojs-fairplay/pull/1.patch","issue_url":"https://api.github.com/repos/chemoish/videojs-fairplay/issues/1","number":1,"state":"open","locked":false,"title":"Feature/init","user":{"login":"chemoish","id":549319,"avatar_url":"https://avatars.githubusercontent.com/u/549319?v=3","gravatar_id":"","url":"https://api.github.com/users/chemoish","html_url":"https://github.com/chemoish","followers_url":"https://api.github.com/users/chemoish/followers","following_url":"https://api.github.com/users/chemoish/following{/other_user}","gists_url":"https://api.github.com/users/chemoish/gists{/gist_id}","starred_url":"https://api.github.com/users/chemoish/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chemoish/subscriptions","organizations_url":"https://api.github.com/users/chemoish/orgs","repos_url":"https://api.github.com/users/chemoish/repos","events_url":"https://api.github.com/users/chemoish/events{/privacy}","received_events_url":"https://api.github.com/users/chemoish/received_events","type":"User","site_admin":false},"body":"","created_at":"2016-08-05T03:15:34Z","updated_at":"2016-08-05T04:28:56Z","closed_at":null,"merged_at":null,"merge_commit_sha":"605849793199677f37b11de2ab404ddd40f3886e","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/chemoish/videojs-fairplay/pulls/1/commits","review_comments_url":"https://api.github.com/repos/chemoish/videojs-fairplay/pulls/1/comments","review_comment_url":"https://api.github.com/repos/chemoish/videojs-fairplay/pulls/comments{/number}","comments_url":"https://api.github.com/repos/chemoish/videojs-fairplay/issues/1/comments","statuses_url":"https://api.github.com/repos/chemoish/videojs-fairplay/statuses/e1f5d4938dec177658cee4f4d96f870090642d13","head":{"label":"chemoish:feature/init","ref":"feature/init","sha":"e1f5d4938dec177658cee4f4d96f870090642d13","user":{"login":"chemoish","id":549319,"avatar_url":"https://avatars.githubusercontent.com/u/549319?v=3","gravatar_id":"","url":"https://api.github.com/users/chemoish","html_url":"https://github.com/chemoish","followers_url":"https://api.github.com/users/chemoish/followers","following_url":"https://api.github.com/users/chemoish/following{/other_user}","gists_url":"https://api.github.com/users/chemoish/gists{/gist_id}","starred_url":"https://api.github.com/users/chemoish/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chemoish/subscriptions","organizations_url":"https://api.github.com/users/chemoish/orgs","repos_url":"https://api.github.com/users/chemoish/repos","events_url":"https://api.github.com/users/chemoish/events{/privacy}","received_events_url":"https://api.github.com/users/chemoish/received_events","type":"User","site_admin":false},"repo":{"id":64960647,"name":"videojs-fairplay","full_name":"chemoish/videojs-fairplay","owner":{"login":"chemoish","id":549319,"avatar_url":"https://avatars.githubusercontent.com/u/549319?v=3","gravatar_id":"","url":"https://api.github.com/users/chemoish","html_url":"https://github.com/chemoish","followers_url":"https://api.github.com/users/chemoish/followers","following_url":"https://api.github.com/users/chemoish/following{/other_user}","gists_url":"https://api.github.com/users/chemoish/gists{/gist_id}","starred_url":"https://api.github.com/users/chemoish/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chemoish/subscriptions","organizations_url":"https://api.github.com/users/chemoish/orgs","repos_url":"https://api.github.com/users/chemoish/repos","events_url":"https://api.github.com/users/chemoish/events{/privacy}","received_events_url":"https://api.github.com/users/chemoish/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/chemoish/videojs-fairplay","description":"Video.js source handler for supporting Fairplay streaming.","fork":false,"url":"https://api.github.com/repos/chemoish/videojs-fairplay","forks_url":"https://api.github.com/repos/chemoish/videojs-fairplay/forks","keys_url":"https://api.github.com/repos/chemoish/videojs-fairplay/keys{/key_id}","collaborators_url":"https://api.github.com/repos/chemoish/videojs-fairplay/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/chemoish/videojs-fairplay/teams","hooks_url":"https://api.github.com/repos/chemoish/videojs-fairplay/hooks","issue_events_url":"https://api.github.com/repos/chemoish/videojs-fairplay/issues/events{/number}","events_url":"https://api.github.com/repos/chemoish/videojs-fairplay/events","assignees_url":"https://api.github.com/repos/chemoish/videojs-fairplay/assignees{/user}","branches_url":"https://api.github.com/repos/chemoish/videojs-fairplay/branches{/branch}","tags_url":"https://api.github.com/repos/chemoish/videojs-fairplay/tags","blobs_url":"https://api.github.com/repos/chemoish/videojs-fairplay/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/chemoish/videojs-fairplay/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/chemoish/videojs-fairplay/git/refs{/sha}","trees_url":"https://api.github.com/repos/chemoish/videojs-fairplay/git/trees{/sha}","statuses_url":"https://api.github.com/repos/chemoish/videojs-fairplay/statuses/{sha}","languages_url":"https://api.github.com/repos/chemoish/videojs-fairplay/languages","stargazers_url":"https://api.github.com/repos/chemoish/videojs-fairplay/stargazers","contributors_url":"https://api.github.com/repos/chemoish/videojs-fairplay/contributors","subscribers_url":"https://api.github.com/repos/chemoish/videojs-fairplay/subscribers","subscription_url":"https://api.github.com/repos/chemoish/videojs-fairplay/subscription","commits_url":"https://api.github.com/repos/chemoish/videojs-fairplay/commits{/sha}","git_commits_url":"https://api.github.com/repos/chemoish/videojs-fairplay/git/commits{/sha}","comments_url":"https://api.github.com/repos/chemoish/videojs-fairplay/comments{/number}","issue_comment_url":"https://api.github.com/repos/chemoish/videojs-fairplay/issues/comments{/number}","contents_url":"https://api.github.com/repos/chemoish/videojs-fairplay/contents/{+path}","compare_url":"https://api.github.com/repos/chemoish/videojs-fairplay/compare/{base}...{head}","merges_url":"https://api.github.com/repos/chemoish/videojs-fairplay/merges","archive_url":"https://api.github.com/repos/chemoish/videojs-fairplay/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/chemoish/videojs-fairplay/downloads","issues_url":"https://api.github.com/repos/chemoish/videojs-fairplay/issues{/number}","pulls_url":"https://api.github.com/repos/chemoish/videojs-fairplay/pulls{/number}","milestones_url":"https://api.github.com/repos/chemoish/videojs-fairplay/milestones{/number}","notifications_url":"https://api.github.com/repos/chemoish/videojs-fairplay/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/chemoish/videojs-fairplay/labels{/name}","releases_url":"https://api.github.com/repos/chemoish/videojs-fairplay/releases{/id}","deployments_url":"https://api.github.com/repos/chemoish/videojs-fairplay/deployments","created_at":"2016-08-04T19:12:20Z","updated_at":"2016-08-04T19:12:20Z","pushed_at":"2016-08-05T03:28:50Z","git_url":"git://github.com/chemoish/videojs-fairplay.git","ssh_url":"git@github.com:chemoish/videojs-fairplay.git","clone_url":"https://github.com/chemoish/videojs-fairplay.git","svn_url":"https://github.com/chemoish/videojs-fairplay","homepage":null,"size":13,"stargazers_count":0,"watchers_count":0,"language":null,"has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"base":{"label":"chemoish:master","ref":"master","sha":"1ef3d2b4d2417837a9d11b8ce3ab14bf32c3aec5","user":{"login":"chemoish","id":549319,"avatar_url":"https://avatars.githubusercontent.com/u/549319?v=3","gravatar_id":"","url":"https://api.github.com/users/chemoish","html_url":"https://github.com/chemoish","followers_url":"https://api.github.com/users/chemoish/followers","following_url":"https://api.github.com/users/chemoish/following{/other_user}","gists_url":"https://api.github.com/users/chemoish/gists{/gist_id}","starred_url":"https://api.github.com/users/chemoish/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chemoish/subscriptions","organizations_url":"https://api.github.com/users/chemoish/orgs","repos_url":"https://api.github.com/users/chemoish/repos","events_url":"https://api.github.com/users/chemoish/events{/privacy}","received_events_url":"https://api.github.com/users/chemoish/received_events","type":"User","site_admin":false},"repo":{"id":64960647,"name":"videojs-fairplay","full_name":"chemoish/videojs-fairplay","owner":{"login":"chemoish","id":549319,"avatar_url":"https://avatars.githubusercontent.com/u/549319?v=3","gravatar_id":"","url":"https://api.github.com/users/chemoish","html_url":"https://github.com/chemoish","followers_url":"https://api.github.com/users/chemoish/followers","following_url":"https://api.github.com/users/chemoish/following{/other_user}","gists_url":"https://api.github.com/users/chemoish/gists{/gist_id}","starred_url":"https://api.github.com/users/chemoish/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chemoish/subscriptions","organizations_url":"https://api.github.com/users/chemoish/orgs","repos_url":"https://api.github.com/users/chemoish/repos","events_url":"https://api.github.com/users/chemoish/events{/privacy}","received_events_url":"https://api.github.com/users/chemoish/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/chemoish/videojs-fairplay","description":"Video.js source handler for supporting Fairplay streaming.","fork":false,"url":"https://api.github.com/repos/chemoish/videojs-fairplay","forks_url":"https://api.github.com/repos/chemoish/videojs-fairplay/forks","keys_url":"https://api.github.com/repos/chemoish/videojs-fairplay/keys{/key_id}","collaborators_url":"https://api.github.com/repos/chemoish/videojs-fairplay/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/chemoish/videojs-fairplay/teams","hooks_url":"https://api.github.com/repos/chemoish/videojs-fairplay/hooks","issue_events_url":"https://api.github.com/repos/chemoish/videojs-fairplay/issues/events{/number}","events_url":"https://api.github.com/repos/chemoish/videojs-fairplay/events","assignees_url":"https://api.github.com/repos/chemoish/videojs-fairplay/assignees{/user}","branches_url":"https://api.github.com/repos/chemoish/videojs-fairplay/branches{/branch}","tags_url":"https://api.github.com/repos/chemoish/videojs-fairplay/tags","blobs_url":"https://api.github.com/repos/chemoish/videojs-fairplay/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/chemoish/videojs-fairplay/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/chemoish/videojs-fairplay/git/refs{/sha}","trees_url":"https://api.github.com/repos/chemoish/videojs-fairplay/git/trees{/sha}","statuses_url":"https://api.github.com/repos/chemoish/videojs-fairplay/statuses/{sha}","languages_url":"https://api.github.com/repos/chemoish/videojs-fairplay/languages","stargazers_url":"https://api.github.com/repos/chemoish/videojs-fairplay/stargazers","contributors_url":"https://api.github.com/repos/chemoish/videojs-fairplay/contributors","subscribers_url":"https://api.github.com/repos/chemoish/videojs-fairplay/subscribers","subscription_url":"https://api.github.com/repos/chemoish/videojs-fairplay/subscription","commits_url":"https://api.github.com/repos/chemoish/videojs-fairplay/commits{/sha}","git_commits_url":"https://api.github.com/repos/chemoish/videojs-fairplay/git/commits{/sha}","comments_url":"https://api.github.com/repos/chemoish/videojs-fairplay/comments{/number}","issue_comment_url":"https://api.github.com/repos/chemoish/videojs-fairplay/issues/comments{/number}","contents_url":"https://api.github.com/repos/chemoish/videojs-fairplay/contents/{+path}","compare_url":"https://api.github.com/repos/chemoish/videojs-fairplay/compare/{base}...{head}","merges_url":"https://api.github.com/repos/chemoish/videojs-fairplay/merges","archive_url":"https://api.github.com/repos/chemoish/videojs-fairplay/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/chemoish/videojs-fairplay/downloads","issues_url":"https://api.github.com/repos/chemoish/videojs-fairplay/issues{/number}","pulls_url":"https://api.github.com/repos/chemoish/videojs-fairplay/pulls{/number}","milestones_url":"https://api.github.com/repos/chemoish/videojs-fairplay/milestones{/number}","notifications_url":"https://api.github.com/repos/chemoish/videojs-fairplay/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/chemoish/videojs-fairplay/labels{/name}","releases_url":"https://api.github.com/repos/chemoish/videojs-fairplay/releases{/id}","deployments_url":"https://api.github.com/repos/chemoish/videojs-fairplay/deployments","created_at":"2016-08-04T19:12:20Z","updated_at":"2016-08-04T19:12:20Z","pushed_at":"2016-08-05T03:28:50Z","git_url":"git://github.com/chemoish/videojs-fairplay.git","ssh_url":"git@github.com:chemoish/videojs-fairplay.git","clone_url":"https://github.com/chemoish/videojs-fairplay.git","svn_url":"https://github.com/chemoish/videojs-fairplay","homepage":null,"size":13,"stargazers_count":0,"watchers_count":0,"language":null,"has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/chemoish/videojs-fairplay/pulls/1"},"html":{"href":"https://github.com/chemoish/videojs-fairplay/pull/1"},"issue":{"href":"https://api.github.com/repos/chemoish/videojs-fairplay/issues/1"},"comments":{"href":"https://api.github.com/repos/chemoish/videojs-fairplay/issues/1/comments"},"review_comments":{"href":"https://api.github.com/repos/chemoish/videojs-fairplay/pulls/1/comments"},"review_comment":{"href":"https://api.github.com/repos/chemoish/videojs-fairplay/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/chemoish/videojs-fairplay/pulls/1/commits"},"statuses":{"href":"https://api.github.com/repos/chemoish/videojs-fairplay/statuses/e1f5d4938dec177658cee4f4d96f870090642d13"}}}}
{"actor":{"display_login":"m14t"}}