{"action":"created","comment":{"url":"https://api.github.com/repos/videojs/videojs-contrib-media-sources/pulls/comments/59432926","id":59432926,"diff_hunk":"@@ -264,4 +264,41 @@ export default class HtmlMediaSource extends videojs.EventTarget {\n     this.sourceBuffers.push(buffer);\n     return buffer;\n   }\n+\n+  /**\n+   * add a property to the VSB indicating the current audio/video/text stream\n+   * properties (sample rate, channels, etc) and fire an event\n+   * when the info changes\n+   *\n+   * @private\n+   * @param {String} type the type of stream to change info on (audio, video, text)\n+   * @param {Object} info info about the currently muxed audio/video/text stream\n+   */\n+  changeInfo_(type, info) {\n+    let propName = `${type}Info_`;\n+    let old = {};\n+\n+    if (!this[propName]) {\n+      this[propName] = info;\n+      return;\n+    }\n+\n+    // copy current properties to another object\n+    for (let prop in this[propName]) {\n+      old[prop] = this[propName][prop];\n+    }\n+\n+    for (let prop in info) {\n+      if (this[propName][prop] !== info[prop]) {\n+        this[propName] = info;\n+        this.trigger({","path":"src/html-media-source.js","position":31,"original_position":31,"commit_id":"6224a9d95522695b89adb5bc53c33e53e3350997","original_commit_id":"6224a9d95522695b89adb5bc53c33e53e3350997","user":{"login":"BrandonOCasey","id":2381475,"avatar_url":"https://avatars.githubusercontent.com/u/2381475?v=3","gravatar_id":"","url":"https://api.github.com/users/BrandonOCasey","html_url":"https://github.com/BrandonOCasey","followers_url":"https://api.github.com/users/BrandonOCasey/followers","following_url":"https://api.github.com/users/BrandonOCasey/following{/other_user}","gists_url":"https://api.github.com/users/BrandonOCasey/gists{/gist_id}","starred_url":"https://api.github.com/users/BrandonOCasey/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/BrandonOCasey/subscriptions","organizations_url":"https://api.github.com/users/BrandonOCasey/orgs","repos_url":"https://api.github.com/users/BrandonOCasey/repos","events_url":"https://api.github.com/users/BrandonOCasey/events{/privacy}","received_events_url":"https://api.github.com/users/BrandonOCasey/received_events","type":"User","site_admin":false},"body":"we use old in HLS to reset the mediasource audio info to the previous value on firefox, so that we don't re-trigger changeInfo again when we switch back to the main audio.","created_at":"2016-04-12T18:53:42Z","updated_at":"2016-04-12T18:53:42Z","html_url":"https://github.com/videojs/videojs-contrib-media-sources/pull/82#discussion_r59432926","pull_request_url":"https://api.github.com/repos/videojs/videojs-contrib-media-sources/pulls/82","_links":{"self":{"href":"https://api.github.com/repos/videojs/videojs-contrib-media-sources/pulls/comments/59432926"},"html":{"href":"https://github.com/videojs/videojs-contrib-media-sources/pull/82#discussion_r59432926"},"pull_request":{"href":"https://api.github.com/repos/videojs/videojs-contrib-media-sources/pulls/82"}}},"pull_request":{"url":"https://api.github.com/repos/videojs/videojs-contrib-media-sources/pulls/82","id":65358945,"html_url":"https://github.com/videojs/videojs-contrib-media-sources/pull/82","diff_url":"https://github.com/videojs/videojs-contrib-media-sources/pull/82.diff","patch_url":"https://github.com/videojs/videojs-contrib-media-sources/pull/82.patch","issue_url":"https://api.github.com/repos/videojs/videojs-contrib-media-sources/issues/82","number":82,"state":"open","locked":false,"title":"save information about the current audio stream on mediaSource","user":{"login":"BrandonOCasey","id":2381475,"avatar_url":"https://avatars.githubusercontent.com/u/2381475?v=3","gravatar_id":"","url":"https://api.github.com/users/BrandonOCasey","html_url":"https://github.com/BrandonOCasey","followers_url":"https://api.github.com/users/BrandonOCasey/followers","following_url":"https://api.github.com/users/BrandonOCasey/following{/other_user}","gists_url":"https://api.github.com/users/BrandonOCasey/gists{/gist_id}","starred_url":"https://api.github.com/users/BrandonOCasey/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/BrandonOCasey/subscriptions","organizations_url":"https://api.github.com/users/BrandonOCasey/orgs","repos_url":"https://api.github.com/users/BrandonOCasey/repos","events_url":"https://api.github.com/users/BrandonOCasey/events{/privacy}","received_events_url":"https://api.github.com/users/BrandonOCasey/received_events","type":"User","site_admin":false},"body":"take that information and emit an audioinfochanged if we detect that it has changed ","created_at":"2016-04-05T19:17:47Z","updated_at":"2016-04-12T18:53:42Z","closed_at":null,"merged_at":null,"merge_commit_sha":"6f77ad5f60b4963a9775fdd2b5e999d1b3a781cf","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/videojs/videojs-contrib-media-sources/pulls/82/commits","review_comments_url":"https://api.github.com/repos/videojs/videojs-contrib-media-sources/pulls/82/comments","review_comment_url":"https://api.github.com/repos/videojs/videojs-contrib-media-sources/pulls/comments{/number}","comments_url":"https://api.github.com/repos/videojs/videojs-contrib-media-sources/issues/82/comments","statuses_url":"https://api.github.com/repos/videojs/videojs-contrib-media-sources/statuses/6224a9d95522695b89adb5bc53c33e53e3350997","head":{"label":"BrandonOCasey:feature/audio-info-change-event","ref":"feature/audio-info-change-event","sha":"6224a9d95522695b89adb5bc53c33e53e3350997","user":{"login":"BrandonOCasey","id":2381475,"avatar_url":"https://avatars.githubusercontent.com/u/2381475?v=3","gravatar_id":"","url":"https://api.github.com/users/BrandonOCasey","html_url":"https://github.com/BrandonOCasey","followers_url":"https://api.github.com/users/BrandonOCasey/followers","following_url":"https://api.github.com/users/BrandonOCasey/following{/other_user}","gists_url":"https://api.github.com/users/BrandonOCasey/gists{/gist_id}","starred_url":"https://api.github.com/users/BrandonOCasey/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/BrandonOCasey/subscriptions","organizations_url":"https://api.github.com/users/BrandonOCasey/orgs","repos_url":"https://api.github.com/users/BrandonOCasey/repos","events_url":"https://api.github.com/users/BrandonOCasey/events{/privacy}","received_events_url":"https://api.github.com/users/BrandonOCasey/received_events","type":"User","site_admin":false},"repo":{"id":48180235,"name":"videojs-contrib-media-sources","full_name":"BrandonOCasey/videojs-contrib-media-sources","owner":{"login":"BrandonOCasey","id":2381475,"avatar_url":"https://avatars.githubusercontent.com/u/2381475?v=3","gravatar_id":"","url":"https://api.github.com/users/BrandonOCasey","html_url":"https://github.com/BrandonOCasey","followers_url":"https://api.github.com/users/BrandonOCasey/followers","following_url":"https://api.github.com/users/BrandonOCasey/following{/other_user}","gists_url":"https://api.github.com/users/BrandonOCasey/gists{/gist_id}","starred_url":"https://api.github.com/users/BrandonOCasey/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/BrandonOCasey/subscriptions","organizations_url":"https://api.github.com/users/BrandonOCasey/orgs","repos_url":"https://api.github.com/users/BrandonOCasey/repos","events_url":"https://api.github.com/users/BrandonOCasey/events{/privacy}","received_events_url":"https://api.github.com/users/BrandonOCasey/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/BrandonOCasey/videojs-contrib-media-sources","description":"Code for working with the media source extensions API and video.js","fork":true,"url":"https://api.github.com/repos/BrandonOCasey/videojs-contrib-media-sources","forks_url":"https://api.github.com/repos/BrandonOCasey/videojs-contrib-media-sources/forks","keys_url":"https://api.github.com/repos/BrandonOCasey/videojs-contrib-media-sources/keys{/key_id}","collaborators_url":"https://api.github.com/repos/BrandonOCasey/videojs-contrib-media-sources/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/BrandonOCasey/videojs-contrib-media-sources/teams","hooks_url":"https://api.github.com/repos/BrandonOCasey/videojs-contrib-media-sources/hooks","issue_events_url":"https://api.github.com/repos/BrandonOCasey/videojs-contrib-media-sources/issues/events{/number}","events_url":"https://api.github.com/repos/BrandonOCasey/videojs-contrib-media-sources/events","assignees_url":"https://api.github.com/repos/BrandonOCasey/videojs-contrib-media-sources/assignees{/user}","branches_url":"https://api.github.com/repos/BrandonOCasey/videojs-contrib-media-sources/branches{/branch}","tags_url":"https://api.github.com/repos/BrandonOCasey/videojs-contrib-media-sources/tags","blobs_url":"https://api.github.com/repos/BrandonOCasey/videojs-contrib-media-sources/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/BrandonOCasey/videojs-contrib-media-sources/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/BrandonOCasey/videojs-contrib-media-sources/git/refs{/sha}","trees_url":"https://api.github.com/repos/BrandonOCasey/videojs-contrib-media-sources/git/trees{/sha}","statuses_url":"https://api.github.com/repos/BrandonOCasey/videojs-contrib-media-sources/statuses/{sha}","languages_url":"https://api.github.com/repos/BrandonOCasey/videojs-contrib-media-sources/languages","stargazers_url":"https://api.github.com/repos/BrandonOCasey/videojs-contrib-media-sources/stargazers","contributors_url":"https://api.github.com/repos/BrandonOCasey/videojs-contrib-media-sources/contributors","subscribers_url":"https://api.github.com/repos/BrandonOCasey/videojs-contrib-media-sources/subscribers","subscription_url":"https://api.github.com/repos/BrandonOCasey/videojs-contrib-media-sources/subscription","commits_url":"https://api.github.com/repos/BrandonOCasey/videojs-contrib-media-sources/commits{/sha}","git_commits_url":"https://api.github.com/repos/BrandonOCasey/videojs-contrib-media-sources/git/commits{/sha}","comments_url":"https://api.github.com/repos/BrandonOCasey/videojs-contrib-media-sources/comments{/number}","issue_comment_url":"https://api.github.com/repos/BrandonOCasey/videojs-contrib-media-sources/issues/comments{/number}","contents_url":"https://api.github.com/repos/BrandonOCasey/videojs-contrib-media-sources/contents/{+path}","compare_url":"https://api.github.com/repos/BrandonOCasey/videojs-contrib-media-sources/compare/{base}...{head}","merges_url":"https://api.github.com/repos/BrandonOCasey/videojs-contrib-media-sources/merges","archive_url":"https://api.github.com/repos/BrandonOCasey/videojs-contrib-media-sources/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/BrandonOCasey/videojs-contrib-media-sources/downloads","issues_url":"https://api.github.com/repos/BrandonOCasey/videojs-contrib-media-sources/issues{/number}","pulls_url":"https://api.github.com/repos/BrandonOCasey/videojs-contrib-media-sources/pulls{/number}","milestones_url":"https://api.github.com/repos/BrandonOCasey/videojs-contrib-media-sources/milestones{/number}","notifications_url":"https://api.github.com/repos/BrandonOCasey/videojs-contrib-media-sources/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/BrandonOCasey/videojs-contrib-media-sources/labels{/name}","releases_url":"https://api.github.com/repos/BrandonOCasey/videojs-contrib-media-sources/releases{/id}","deployments_url":"https://api.github.com/repos/BrandonOCasey/videojs-contrib-media-sources/deployments","created_at":"2015-12-17T14:52:55Z","updated_at":"2016-01-13T16:30:13Z","pushed_at":"2016-04-11T15:55:08Z","git_url":"git://github.com/BrandonOCasey/videojs-contrib-media-sources.git","ssh_url":"git@github.com:BrandonOCasey/videojs-contrib-media-sources.git","clone_url":"https://github.com/BrandonOCasey/videojs-contrib-media-sources.git","svn_url":"https://github.com/BrandonOCasey/videojs-contrib-media-sources","homepage":null,"size":525,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":0,"forks":1,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"videojs:development","ref":"development","sha":"8edef6b1746b644a7caa764f01993dbd81465c79","user":{"login":"videojs","id":3287189,"avatar_url":"https://avatars.githubusercontent.com/u/3287189?v=3","gravatar_id":"","url":"https://api.github.com/users/videojs","html_url":"https://github.com/videojs","followers_url":"https://api.github.com/users/videojs/followers","following_url":"https://api.github.com/users/videojs/following{/other_user}","gists_url":"https://api.github.com/users/videojs/gists{/gist_id}","starred_url":"https://api.github.com/users/videojs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/videojs/subscriptions","organizations_url":"https://api.github.com/users/videojs/orgs","repos_url":"https://api.github.com/users/videojs/repos","events_url":"https://api.github.com/users/videojs/events{/privacy}","received_events_url":"https://api.github.com/users/videojs/received_events","type":"Organization","site_admin":false},"repo":{"id":13849292,"name":"videojs-contrib-media-sources","full_name":"videojs/videojs-contrib-media-sources","owner":{"login":"videojs","id":3287189,"avatar_url":"https://avatars.githubusercontent.com/u/3287189?v=3","gravatar_id":"","url":"https://api.github.com/users/videojs","html_url":"https://github.com/videojs","followers_url":"https://api.github.com/users/videojs/followers","following_url":"https://api.github.com/users/videojs/following{/other_user}","gists_url":"https://api.github.com/users/videojs/gists{/gist_id}","starred_url":"https://api.github.com/users/videojs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/videojs/subscriptions","organizations_url":"https://api.github.com/users/videojs/orgs","repos_url":"https://api.github.com/users/videojs/repos","events_url":"https://api.github.com/users/videojs/events{/privacy}","received_events_url":"https://api.github.com/users/videojs/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/videojs/videojs-contrib-media-sources","description":"Code for working with the media source extensions API and video.js","fork":false,"url":"https://api.github.com/repos/videojs/videojs-contrib-media-sources","forks_url":"https://api.github.com/repos/videojs/videojs-contrib-media-sources/forks","keys_url":"https://api.github.com/repos/videojs/videojs-contrib-media-sources/keys{/key_id}","collaborators_url":"https://api.github.com/repos/videojs/videojs-contrib-media-sources/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/videojs/videojs-contrib-media-sources/teams","hooks_url":"https://api.github.com/repos/videojs/videojs-contrib-media-sources/hooks","issue_events_url":"https://api.github.com/repos/videojs/videojs-contrib-media-sources/issues/events{/number}","events_url":"https://api.github.com/repos/videojs/videojs-contrib-media-sources/events","assignees_url":"https://api.github.com/repos/videojs/videojs-contrib-media-sources/assignees{/user}","branches_url":"https://api.github.com/repos/videojs/videojs-contrib-media-sources/branches{/branch}","tags_url":"https://api.github.com/repos/videojs/videojs-contrib-media-sources/tags","blobs_url":"https://api.github.com/repos/videojs/videojs-contrib-media-sources/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/videojs/videojs-contrib-media-sources/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/videojs/videojs-contrib-media-sources/git/refs{/sha}","trees_url":"https://api.github.com/repos/videojs/videojs-contrib-media-sources/git/trees{/sha}","statuses_url":"https://api.github.com/repos/videojs/videojs-contrib-media-sources/statuses/{sha}","languages_url":"https://api.github.com/repos/videojs/videojs-contrib-media-sources/languages","stargazers_url":"https://api.github.com/repos/videojs/videojs-contrib-media-sources/stargazers","contributors_url":"https://api.github.com/repos/videojs/videojs-contrib-media-sources/contributors","subscribers_url":"https://api.github.com/repos/videojs/videojs-contrib-media-sources/subscribers","subscription_url":"https://api.github.com/repos/videojs/videojs-contrib-media-sources/subscription","commits_url":"https://api.github.com/repos/videojs/videojs-contrib-media-sources/commits{/sha}","git_commits_url":"https://api.github.com/repos/videojs/videojs-contrib-media-sources/git/commits{/sha}","comments_url":"https://api.github.com/repos/videojs/videojs-contrib-media-sources/comments{/number}","issue_comment_url":"https://api.github.com/repos/videojs/videojs-contrib-media-sources/issues/comments{/number}","contents_url":"https://api.github.com/repos/videojs/videojs-contrib-media-sources/contents/{+path}","compare_url":"https://api.github.com/repos/videojs/videojs-contrib-media-sources/compare/{base}...{head}","merges_url":"https://api.github.com/repos/videojs/videojs-contrib-media-sources/merges","archive_url":"https://api.github.com/repos/videojs/videojs-contrib-media-sources/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/videojs/videojs-contrib-media-sources/downloads","issues_url":"https://api.github.com/repos/videojs/videojs-contrib-media-sources/issues{/number}","pulls_url":"https://api.github.com/repos/videojs/videojs-contrib-media-sources/pulls{/number}","milestones_url":"https://api.github.com/repos/videojs/videojs-contrib-media-sources/milestones{/number}","notifications_url":"https://api.github.com/repos/videojs/videojs-contrib-media-sources/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/videojs/videojs-contrib-media-sources/labels{/name}","releases_url":"https://api.github.com/repos/videojs/videojs-contrib-media-sources/releases{/id}","deployments_url":"https://api.github.com/repos/videojs/videojs-contrib-media-sources/deployments","created_at":"2013-10-25T02:01:24Z","updated_at":"2016-04-08T14:41:49Z","pushed_at":"2016-04-11T15:55:08Z","git_url":"git://github.com/videojs/videojs-contrib-media-sources.git","ssh_url":"git@github.com:videojs/videojs-contrib-media-sources.git","clone_url":"https://github.com/videojs/videojs-contrib-media-sources.git","svn_url":"https://github.com/videojs/videojs-contrib-media-sources","homepage":null,"size":835,"stargazers_count":72,"watchers_count":72,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":79,"mirror_url":null,"open_issues_count":6,"forks":79,"open_issues":6,"watchers":72,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/videojs/videojs-contrib-media-sources/pulls/82"},"html":{"href":"https://github.com/videojs/videojs-contrib-media-sources/pull/82"},"issue":{"href":"https://api.github.com/repos/videojs/videojs-contrib-media-sources/issues/82"},"comments":{"href":"https://api.github.com/repos/videojs/videojs-contrib-media-sources/issues/82/comments"},"review_comments":{"href":"https://api.github.com/repos/videojs/videojs-contrib-media-sources/pulls/82/comments"},"review_comment":{"href":"https://api.github.com/repos/videojs/videojs-contrib-media-sources/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/videojs/videojs-contrib-media-sources/pulls/82/commits"},"statuses":{"href":"https://api.github.com/repos/videojs/videojs-contrib-media-sources/statuses/6224a9d95522695b89adb5bc53c33e53e3350997"}}}}