{"action":"created","comment":{"url":"https://api.github.com/repos/videojs/videojs-contrib-hls/pulls/comments/47304472","id":47304472,"diff_hunk":"@@ -982,7 +982,26 @@ videojs.HlsHandler.prototype.blacklistCurrentPlaylist_ = function(error) {\n videojs.HlsHandler.prototype.loadSegment = function(segmentInfo) {\n   var\n     self = this,\n-    segment = segmentInfo.playlist.segments[segmentInfo.mediaIndex];\n+    segment = segmentInfo.playlist.segments[segmentInfo.mediaIndex],\n+    removeToTime = 0,\n+    seekable = this.seekable();\n+\n+  // Chrome has a hard limit of 150mb of buffer and a very conservative \"garbage collector\"\n+  // We manually clear out the old buffer to ensure we don't trigger the QuotaExceeded error\n+  // on the source buffer during subsequent appends\n+  if (this.sourceBuffer) {\n+    // If we have a seekable range use that as the limit for what can be removed safely\n+    // otherwise remove anything older than 1 minute before the current play head\n+    if (seekable.length && seekable.start(0) > 0) {\n+      removeToTime = seekable.start(0);\n+    } else {\n+      removeToTime = this.tech_.currentTime() - 60;","path":"src/videojs-hls.js","position":18,"original_position":18,"commit_id":"8b13aaa98be6120d79bf1d414453b93bcca39e8a","original_commit_id":"8b13aaa98be6120d79bf1d414453b93bcca39e8a","user":{"login":"dmlap","id":56667,"avatar_url":"https://avatars.githubusercontent.com/u/56667?v=3","gravatar_id":"","url":"https://api.github.com/users/dmlap","html_url":"https://github.com/dmlap","followers_url":"https://api.github.com/users/dmlap/followers","following_url":"https://api.github.com/users/dmlap/following{/other_user}","gists_url":"https://api.github.com/users/dmlap/gists{/gist_id}","starred_url":"https://api.github.com/users/dmlap/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dmlap/subscriptions","organizations_url":"https://api.github.com/users/dmlap/orgs","repos_url":"https://api.github.com/users/dmlap/repos","events_url":"https://api.github.com/users/dmlap/events{/privacy}","received_events_url":"https://api.github.com/users/dmlap/received_events","type":"User","site_admin":false},"body":"This might be a controversial move but I'm ok with trying it for awhile.","created_at":"2015-12-10T23:49:50Z","updated_at":"2015-12-10T23:49:50Z","html_url":"https://github.com/videojs/videojs-contrib-hls/pull/470#discussion_r47304472","pull_request_url":"https://api.github.com/repos/videojs/videojs-contrib-hls/pulls/470","_links":{"self":{"href":"https://api.github.com/repos/videojs/videojs-contrib-hls/pulls/comments/47304472"},"html":{"href":"https://github.com/videojs/videojs-contrib-hls/pull/470#discussion_r47304472"},"pull_request":{"href":"https://api.github.com/repos/videojs/videojs-contrib-hls/pulls/470"}}},"pull_request":{"url":"https://api.github.com/repos/videojs/videojs-contrib-hls/pulls/470","id":53199232,"html_url":"https://github.com/videojs/videojs-contrib-hls/pull/470","diff_url":"https://github.com/videojs/videojs-contrib-hls/pull/470.diff","patch_url":"https://github.com/videojs/videojs-contrib-hls/pull/470.patch","issue_url":"https://api.github.com/repos/videojs/videojs-contrib-hls/issues/470","number":470,"state":"open","locked":false,"title":"Remove from buffer","user":{"login":"imbcmdth","id":162465,"avatar_url":"https://avatars.githubusercontent.com/u/162465?v=3","gravatar_id":"","url":"https://api.github.com/users/imbcmdth","html_url":"https://github.com/imbcmdth","followers_url":"https://api.github.com/users/imbcmdth/followers","following_url":"https://api.github.com/users/imbcmdth/following{/other_user}","gists_url":"https://api.github.com/users/imbcmdth/gists{/gist_id}","starred_url":"https://api.github.com/users/imbcmdth/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/imbcmdth/subscriptions","organizations_url":"https://api.github.com/users/imbcmdth/orgs","repos_url":"https://api.github.com/users/imbcmdth/repos","events_url":"https://api.github.com/users/imbcmdth/events{/privacy}","received_events_url":"https://api.github.com/users/imbcmdth/received_events","type":"User","site_admin":false},"body":"Call `remove` on the sourceBuffer when loading a segment to trim the length of the buffer before the `currentTime`. Chrome will often fail to \"garbage collect\" sufficient space on a long-lived sourceBuffer and fail with a **QuotaExceeded** error. This is a work-around to force removal of old data from the sourceBuffer before we ever try to append.","created_at":"2015-12-10T00:22:52Z","updated_at":"2015-12-10T23:49:50Z","closed_at":null,"merged_at":null,"merge_commit_sha":"4e66ee2fbfddb776ad4f2247ffa1e71106a49849","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/videojs/videojs-contrib-hls/pulls/470/commits","review_comments_url":"https://api.github.com/repos/videojs/videojs-contrib-hls/pulls/470/comments","review_comment_url":"https://api.github.com/repos/videojs/videojs-contrib-hls/pulls/comments{/number}","comments_url":"https://api.github.com/repos/videojs/videojs-contrib-hls/issues/470/comments","statuses_url":"https://api.github.com/repos/videojs/videojs-contrib-hls/statuses/8b13aaa98be6120d79bf1d414453b93bcca39e8a","head":{"label":"videojs:remove-from-buffer","ref":"remove-from-buffer","sha":"8b13aaa98be6120d79bf1d414453b93bcca39e8a","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":14029328,"name":"videojs-contrib-hls","full_name":"videojs/videojs-contrib-hls","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-hls","description":"HLS library for video.js","fork":false,"url":"https://api.github.com/repos/videojs/videojs-contrib-hls","forks_url":"https://api.github.com/repos/videojs/videojs-contrib-hls/forks","keys_url":"https://api.github.com/repos/videojs/videojs-contrib-hls/keys{/key_id}","collaborators_url":"https://api.github.com/repos/videojs/videojs-contrib-hls/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/videojs/videojs-contrib-hls/teams","hooks_url":"https://api.github.com/repos/videojs/videojs-contrib-hls/hooks","issue_events_url":"https://api.github.com/repos/videojs/videojs-contrib-hls/issues/events{/number}","events_url":"https://api.github.com/repos/videojs/videojs-contrib-hls/events","assignees_url":"https://api.github.com/repos/videojs/videojs-contrib-hls/assignees{/user}","branches_url":"https://api.github.com/repos/videojs/videojs-contrib-hls/branches{/branch}","tags_url":"https://api.github.com/repos/videojs/videojs-contrib-hls/tags","blobs_url":"https://api.github.com/repos/videojs/videojs-contrib-hls/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/videojs/videojs-contrib-hls/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/videojs/videojs-contrib-hls/git/refs{/sha}","trees_url":"https://api.github.com/repos/videojs/videojs-contrib-hls/git/trees{/sha}","statuses_url":"https://api.github.com/repos/videojs/videojs-contrib-hls/statuses/{sha}","languages_url":"https://api.github.com/repos/videojs/videojs-contrib-hls/languages","stargazers_url":"https://api.github.com/repos/videojs/videojs-contrib-hls/stargazers","contributors_url":"https://api.github.com/repos/videojs/videojs-contrib-hls/contributors","subscribers_url":"https://api.github.com/repos/videojs/videojs-contrib-hls/subscribers","subscription_url":"https://api.github.com/repos/videojs/videojs-contrib-hls/subscription","commits_url":"https://api.github.com/repos/videojs/videojs-contrib-hls/commits{/sha}","git_commits_url":"https://api.github.com/repos/videojs/videojs-contrib-hls/git/commits{/sha}","comments_url":"https://api.github.com/repos/videojs/videojs-contrib-hls/comments{/number}","issue_comment_url":"https://api.github.com/repos/videojs/videojs-contrib-hls/issues/comments{/number}","contents_url":"https://api.github.com/repos/videojs/videojs-contrib-hls/contents/{+path}","compare_url":"https://api.github.com/repos/videojs/videojs-contrib-hls/compare/{base}...{head}","merges_url":"https://api.github.com/repos/videojs/videojs-contrib-hls/merges","archive_url":"https://api.github.com/repos/videojs/videojs-contrib-hls/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/videojs/videojs-contrib-hls/downloads","issues_url":"https://api.github.com/repos/videojs/videojs-contrib-hls/issues{/number}","pulls_url":"https://api.github.com/repos/videojs/videojs-contrib-hls/pulls{/number}","milestones_url":"https://api.github.com/repos/videojs/videojs-contrib-hls/milestones{/number}","notifications_url":"https://api.github.com/repos/videojs/videojs-contrib-hls/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/videojs/videojs-contrib-hls/labels{/name}","releases_url":"https://api.github.com/repos/videojs/videojs-contrib-hls/releases{/id}","created_at":"2013-10-31T21:55:21Z","updated_at":"2015-12-10T12:39:09Z","pushed_at":"2015-12-10T00:22:52Z","git_url":"git://github.com/videojs/videojs-contrib-hls.git","ssh_url":"git@github.com:videojs/videojs-contrib-hls.git","clone_url":"https://github.com/videojs/videojs-contrib-hls.git","svn_url":"https://github.com/videojs/videojs-contrib-hls","homepage":"http://videojs.github.io/videojs-contrib-hls/","size":22627,"stargazers_count":382,"watchers_count":382,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":190,"mirror_url":null,"open_issues_count":78,"forks":190,"open_issues":78,"watchers":382,"default_branch":"master"}},"base":{"label":"videojs:development","ref":"development","sha":"9eb8c8febf5ba29f5fbe165fea96f8b903433065","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":14029328,"name":"videojs-contrib-hls","full_name":"videojs/videojs-contrib-hls","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-hls","description":"HLS library for video.js","fork":false,"url":"https://api.github.com/repos/videojs/videojs-contrib-hls","forks_url":"https://api.github.com/repos/videojs/videojs-contrib-hls/forks","keys_url":"https://api.github.com/repos/videojs/videojs-contrib-hls/keys{/key_id}","collaborators_url":"https://api.github.com/repos/videojs/videojs-contrib-hls/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/videojs/videojs-contrib-hls/teams","hooks_url":"https://api.github.com/repos/videojs/videojs-contrib-hls/hooks","issue_events_url":"https://api.github.com/repos/videojs/videojs-contrib-hls/issues/events{/number}","events_url":"https://api.github.com/repos/videojs/videojs-contrib-hls/events","assignees_url":"https://api.github.com/repos/videojs/videojs-contrib-hls/assignees{/user}","branches_url":"https://api.github.com/repos/videojs/videojs-contrib-hls/branches{/branch}","tags_url":"https://api.github.com/repos/videojs/videojs-contrib-hls/tags","blobs_url":"https://api.github.com/repos/videojs/videojs-contrib-hls/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/videojs/videojs-contrib-hls/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/videojs/videojs-contrib-hls/git/refs{/sha}","trees_url":"https://api.github.com/repos/videojs/videojs-contrib-hls/git/trees{/sha}","statuses_url":"https://api.github.com/repos/videojs/videojs-contrib-hls/statuses/{sha}","languages_url":"https://api.github.com/repos/videojs/videojs-contrib-hls/languages","stargazers_url":"https://api.github.com/repos/videojs/videojs-contrib-hls/stargazers","contributors_url":"https://api.github.com/repos/videojs/videojs-contrib-hls/contributors","subscribers_url":"https://api.github.com/repos/videojs/videojs-contrib-hls/subscribers","subscription_url":"https://api.github.com/repos/videojs/videojs-contrib-hls/subscription","commits_url":"https://api.github.com/repos/videojs/videojs-contrib-hls/commits{/sha}","git_commits_url":"https://api.github.com/repos/videojs/videojs-contrib-hls/git/commits{/sha}","comments_url":"https://api.github.com/repos/videojs/videojs-contrib-hls/comments{/number}","issue_comment_url":"https://api.github.com/repos/videojs/videojs-contrib-hls/issues/comments{/number}","contents_url":"https://api.github.com/repos/videojs/videojs-contrib-hls/contents/{+path}","compare_url":"https://api.github.com/repos/videojs/videojs-contrib-hls/compare/{base}...{head}","merges_url":"https://api.github.com/repos/videojs/videojs-contrib-hls/merges","archive_url":"https://api.github.com/repos/videojs/videojs-contrib-hls/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/videojs/videojs-contrib-hls/downloads","issues_url":"https://api.github.com/repos/videojs/videojs-contrib-hls/issues{/number}","pulls_url":"https://api.github.com/repos/videojs/videojs-contrib-hls/pulls{/number}","milestones_url":"https://api.github.com/repos/videojs/videojs-contrib-hls/milestones{/number}","notifications_url":"https://api.github.com/repos/videojs/videojs-contrib-hls/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/videojs/videojs-contrib-hls/labels{/name}","releases_url":"https://api.github.com/repos/videojs/videojs-contrib-hls/releases{/id}","created_at":"2013-10-31T21:55:21Z","updated_at":"2015-12-10T12:39:09Z","pushed_at":"2015-12-10T00:22:52Z","git_url":"git://github.com/videojs/videojs-contrib-hls.git","ssh_url":"git@github.com:videojs/videojs-contrib-hls.git","clone_url":"https://github.com/videojs/videojs-contrib-hls.git","svn_url":"https://github.com/videojs/videojs-contrib-hls","homepage":"http://videojs.github.io/videojs-contrib-hls/","size":22627,"stargazers_count":382,"watchers_count":382,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":190,"mirror_url":null,"open_issues_count":78,"forks":190,"open_issues":78,"watchers":382,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/videojs/videojs-contrib-hls/pulls/470"},"html":{"href":"https://github.com/videojs/videojs-contrib-hls/pull/470"},"issue":{"href":"https://api.github.com/repos/videojs/videojs-contrib-hls/issues/470"},"comments":{"href":"https://api.github.com/repos/videojs/videojs-contrib-hls/issues/470/comments"},"review_comments":{"href":"https://api.github.com/repos/videojs/videojs-contrib-hls/pulls/470/comments"},"review_comment":{"href":"https://api.github.com/repos/videojs/videojs-contrib-hls/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/videojs/videojs-contrib-hls/pulls/470/commits"},"statuses":{"href":"https://api.github.com/repos/videojs/videojs-contrib-hls/statuses/8b13aaa98be6120d79bf1d414453b93bcca39e8a"}}}}