{"action":"created","comment":{"url":"https://api.github.com/repos/dailymotion/hls.js/pulls/comments/71851832","id":71851832,"diff_hunk":"@@ -63,27 +51,29 @@ class XhrLoader {\n     xhr.onloadend = this.loadend.bind(this);\n     xhr.onprogress = this.loadprogress.bind(this);\n \n-    xhr.open('GET', this.url, true);\n-    if (this.byteRange) {\n-      xhr.setRequestHeader('Range', 'bytes=' + this.byteRange);\n+    xhr.open('GET', context.url, true);\n+\n+    if (context.rangeEnd) {\n+      xhr.setRequestHeader('Range','bytes=' + context.rangeStart + '-' + (context.rangeEnd-1));\n     }\n-    xhr.responseType = this.responseType;\n+    xhr.responseType = context.responseType;\n     let stats = this.stats;\n     stats.tfirst = 0;\n     stats.loaded = 0;\n     if (this.xhrSetup) {\n-      this.xhrSetup(xhr, this.url);\n+      this.xhrSetup(xhr, context.url);","path":"src/utils/xhr-loader.js","position":54,"original_position":54,"commit_id":"9df1385282ba8efbc765b5175780449dfcc6134a","original_commit_id":"9df1385282ba8efbc765b5175780449dfcc6134a","user":{"login":"AxelDelmas","id":5991128,"avatar_url":"https://avatars.githubusercontent.com/u/5991128?v=3","gravatar_id":"","url":"https://api.github.com/users/AxelDelmas","html_url":"https://github.com/AxelDelmas","followers_url":"https://api.github.com/users/AxelDelmas/followers","following_url":"https://api.github.com/users/AxelDelmas/following{/other_user}","gists_url":"https://api.github.com/users/AxelDelmas/gists{/gist_id}","starred_url":"https://api.github.com/users/AxelDelmas/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AxelDelmas/subscriptions","organizations_url":"https://api.github.com/users/AxelDelmas/orgs","repos_url":"https://api.github.com/users/AxelDelmas/repos","events_url":"https://api.github.com/users/AxelDelmas/events{/privacy}","received_events_url":"https://api.github.com/users/AxelDelmas/received_events","type":"User","site_admin":false},"body":"Could we make this method generic? Not sure if really possible, but it would be more consistent if we have the same method in every loader:\r\n`genericLoaderSetup(context, config)` with a generic way to pass headers / credentials in the config object.\r\n\r\nIf this is too cumbersome, or if there's a real need to access xhr itself through xhrSetup, it would be great to keep the signature of these `xxxSetup` consistent: maybe `(context, config, custom)`. This would provide guidelines for custom loaders that have to provide yet another `xxxSetup` callback.\r\nThis would give something like:\r\n`this.xhrSetup(context, null, xhr);` and `this.fetchSetup(context, initParams, null);`\r\n","created_at":"2016-07-22T09:31:45Z","updated_at":"2016-07-22T09:31:45Z","html_url":"https://github.com/dailymotion/hls.js/pull/587#discussion_r71851832","pull_request_url":"https://api.github.com/repos/dailymotion/hls.js/pulls/587","_links":{"self":{"href":"https://api.github.com/repos/dailymotion/hls.js/pulls/comments/71851832"},"html":{"href":"https://github.com/dailymotion/hls.js/pull/587#discussion_r71851832"},"pull_request":{"href":"https://api.github.com/repos/dailymotion/hls.js/pulls/587"}}},"pull_request":{"url":"https://api.github.com/repos/dailymotion/hls.js/pulls/587","id":78112775,"html_url":"https://github.com/dailymotion/hls.js/pull/587","diff_url":"https://github.com/dailymotion/hls.js/pull/587.diff","patch_url":"https://github.com/dailymotion/hls.js/pull/587.patch","issue_url":"https://api.github.com/repos/dailymotion/hls.js/issues/587","number":587,"state":"open","locked":false,"title":"improve Loader Interface","user":{"login":"mangui","id":1798553,"avatar_url":"https://avatars.githubusercontent.com/u/1798553?v=3","gravatar_id":"","url":"https://api.github.com/users/mangui","html_url":"https://github.com/mangui","followers_url":"https://api.github.com/users/mangui/followers","following_url":"https://api.github.com/users/mangui/following{/other_user}","gists_url":"https://api.github.com/users/mangui/gists{/gist_id}","starred_url":"https://api.github.com/users/mangui/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mangui/subscriptions","organizations_url":"https://api.github.com/users/mangui/orgs","repos_url":"https://api.github.com/users/mangui/repos","events_url":"https://api.github.com/users/mangui/events{/privacy}","received_events_url":"https://api.github.com/users/mangui/received_events","type":"User","site_admin":false},"body":" - [ ] get rid of XHR dependencies\r\n - [ ] Fetch compatible\r\n - [ ] support fragment progressive parsing ","created_at":"2016-07-20T09:12:21Z","updated_at":"2016-07-22T09:31:45Z","closed_at":null,"merged_at":null,"merge_commit_sha":"385ba85c1d2903666c761e0d7de00cd9b4691b60","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/dailymotion/hls.js/pulls/587/commits","review_comments_url":"https://api.github.com/repos/dailymotion/hls.js/pulls/587/comments","review_comment_url":"https://api.github.com/repos/dailymotion/hls.js/pulls/comments{/number}","comments_url":"https://api.github.com/repos/dailymotion/hls.js/issues/587/comments","statuses_url":"https://api.github.com/repos/dailymotion/hls.js/statuses/9df1385282ba8efbc765b5175780449dfcc6134a","head":{"label":"dailymotion:loader","ref":"loader","sha":"9df1385282ba8efbc765b5175780449dfcc6134a","user":{"login":"dailymotion","id":115313,"avatar_url":"https://avatars.githubusercontent.com/u/115313?v=3","gravatar_id":"","url":"https://api.github.com/users/dailymotion","html_url":"https://github.com/dailymotion","followers_url":"https://api.github.com/users/dailymotion/followers","following_url":"https://api.github.com/users/dailymotion/following{/other_user}","gists_url":"https://api.github.com/users/dailymotion/gists{/gist_id}","starred_url":"https://api.github.com/users/dailymotion/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dailymotion/subscriptions","organizations_url":"https://api.github.com/users/dailymotion/orgs","repos_url":"https://api.github.com/users/dailymotion/repos","events_url":"https://api.github.com/users/dailymotion/events{/privacy}","received_events_url":"https://api.github.com/users/dailymotion/received_events","type":"Organization","site_admin":false},"repo":{"id":30064588,"name":"hls.js","full_name":"dailymotion/hls.js","owner":{"login":"dailymotion","id":115313,"avatar_url":"https://avatars.githubusercontent.com/u/115313?v=3","gravatar_id":"","url":"https://api.github.com/users/dailymotion","html_url":"https://github.com/dailymotion","followers_url":"https://api.github.com/users/dailymotion/followers","following_url":"https://api.github.com/users/dailymotion/following{/other_user}","gists_url":"https://api.github.com/users/dailymotion/gists{/gist_id}","starred_url":"https://api.github.com/users/dailymotion/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dailymotion/subscriptions","organizations_url":"https://api.github.com/users/dailymotion/orgs","repos_url":"https://api.github.com/users/dailymotion/repos","events_url":"https://api.github.com/users/dailymotion/events{/privacy}","received_events_url":"https://api.github.com/users/dailymotion/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/dailymotion/hls.js","description":"MSE-based HLS client - http://dailymotion.github.io/hls.js/demo","fork":false,"url":"https://api.github.com/repos/dailymotion/hls.js","forks_url":"https://api.github.com/repos/dailymotion/hls.js/forks","keys_url":"https://api.github.com/repos/dailymotion/hls.js/keys{/key_id}","collaborators_url":"https://api.github.com/repos/dailymotion/hls.js/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/dailymotion/hls.js/teams","hooks_url":"https://api.github.com/repos/dailymotion/hls.js/hooks","issue_events_url":"https://api.github.com/repos/dailymotion/hls.js/issues/events{/number}","events_url":"https://api.github.com/repos/dailymotion/hls.js/events","assignees_url":"https://api.github.com/repos/dailymotion/hls.js/assignees{/user}","branches_url":"https://api.github.com/repos/dailymotion/hls.js/branches{/branch}","tags_url":"https://api.github.com/repos/dailymotion/hls.js/tags","blobs_url":"https://api.github.com/repos/dailymotion/hls.js/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/dailymotion/hls.js/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/dailymotion/hls.js/git/refs{/sha}","trees_url":"https://api.github.com/repos/dailymotion/hls.js/git/trees{/sha}","statuses_url":"https://api.github.com/repos/dailymotion/hls.js/statuses/{sha}","languages_url":"https://api.github.com/repos/dailymotion/hls.js/languages","stargazers_url":"https://api.github.com/repos/dailymotion/hls.js/stargazers","contributors_url":"https://api.github.com/repos/dailymotion/hls.js/contributors","subscribers_url":"https://api.github.com/repos/dailymotion/hls.js/subscribers","subscription_url":"https://api.github.com/repos/dailymotion/hls.js/subscription","commits_url":"https://api.github.com/repos/dailymotion/hls.js/commits{/sha}","git_commits_url":"https://api.github.com/repos/dailymotion/hls.js/git/commits{/sha}","comments_url":"https://api.github.com/repos/dailymotion/hls.js/comments{/number}","issue_comment_url":"https://api.github.com/repos/dailymotion/hls.js/issues/comments{/number}","contents_url":"https://api.github.com/repos/dailymotion/hls.js/contents/{+path}","compare_url":"https://api.github.com/repos/dailymotion/hls.js/compare/{base}...{head}","merges_url":"https://api.github.com/repos/dailymotion/hls.js/merges","archive_url":"https://api.github.com/repos/dailymotion/hls.js/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/dailymotion/hls.js/downloads","issues_url":"https://api.github.com/repos/dailymotion/hls.js/issues{/number}","pulls_url":"https://api.github.com/repos/dailymotion/hls.js/pulls{/number}","milestones_url":"https://api.github.com/repos/dailymotion/hls.js/milestones{/number}","notifications_url":"https://api.github.com/repos/dailymotion/hls.js/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/dailymotion/hls.js/labels{/name}","releases_url":"https://api.github.com/repos/dailymotion/hls.js/releases{/id}","deployments_url":"https://api.github.com/repos/dailymotion/hls.js/deployments","created_at":"2015-01-30T09:06:27Z","updated_at":"2016-07-22T07:13:23Z","pushed_at":"2016-07-21T20:02:31Z","git_url":"git://github.com/dailymotion/hls.js.git","ssh_url":"git@github.com:dailymotion/hls.js.git","clone_url":"https://github.com/dailymotion/hls.js.git","svn_url":"https://github.com/dailymotion/hls.js","homepage":"","size":13215,"stargazers_count":958,"watchers_count":958,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":240,"mirror_url":null,"open_issues_count":170,"forks":240,"open_issues":170,"watchers":958,"default_branch":"master"}},"base":{"label":"dailymotion:master","ref":"master","sha":"a7bb6b41a023c1aeb3b44a8373f9af9fe3a55f4a","user":{"login":"dailymotion","id":115313,"avatar_url":"https://avatars.githubusercontent.com/u/115313?v=3","gravatar_id":"","url":"https://api.github.com/users/dailymotion","html_url":"https://github.com/dailymotion","followers_url":"https://api.github.com/users/dailymotion/followers","following_url":"https://api.github.com/users/dailymotion/following{/other_user}","gists_url":"https://api.github.com/users/dailymotion/gists{/gist_id}","starred_url":"https://api.github.com/users/dailymotion/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dailymotion/subscriptions","organizations_url":"https://api.github.com/users/dailymotion/orgs","repos_url":"https://api.github.com/users/dailymotion/repos","events_url":"https://api.github.com/users/dailymotion/events{/privacy}","received_events_url":"https://api.github.com/users/dailymotion/received_events","type":"Organization","site_admin":false},"repo":{"id":30064588,"name":"hls.js","full_name":"dailymotion/hls.js","owner":{"login":"dailymotion","id":115313,"avatar_url":"https://avatars.githubusercontent.com/u/115313?v=3","gravatar_id":"","url":"https://api.github.com/users/dailymotion","html_url":"https://github.com/dailymotion","followers_url":"https://api.github.com/users/dailymotion/followers","following_url":"https://api.github.com/users/dailymotion/following{/other_user}","gists_url":"https://api.github.com/users/dailymotion/gists{/gist_id}","starred_url":"https://api.github.com/users/dailymotion/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dailymotion/subscriptions","organizations_url":"https://api.github.com/users/dailymotion/orgs","repos_url":"https://api.github.com/users/dailymotion/repos","events_url":"https://api.github.com/users/dailymotion/events{/privacy}","received_events_url":"https://api.github.com/users/dailymotion/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/dailymotion/hls.js","description":"MSE-based HLS client - http://dailymotion.github.io/hls.js/demo","fork":false,"url":"https://api.github.com/repos/dailymotion/hls.js","forks_url":"https://api.github.com/repos/dailymotion/hls.js/forks","keys_url":"https://api.github.com/repos/dailymotion/hls.js/keys{/key_id}","collaborators_url":"https://api.github.com/repos/dailymotion/hls.js/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/dailymotion/hls.js/teams","hooks_url":"https://api.github.com/repos/dailymotion/hls.js/hooks","issue_events_url":"https://api.github.com/repos/dailymotion/hls.js/issues/events{/number}","events_url":"https://api.github.com/repos/dailymotion/hls.js/events","assignees_url":"https://api.github.com/repos/dailymotion/hls.js/assignees{/user}","branches_url":"https://api.github.com/repos/dailymotion/hls.js/branches{/branch}","tags_url":"https://api.github.com/repos/dailymotion/hls.js/tags","blobs_url":"https://api.github.com/repos/dailymotion/hls.js/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/dailymotion/hls.js/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/dailymotion/hls.js/git/refs{/sha}","trees_url":"https://api.github.com/repos/dailymotion/hls.js/git/trees{/sha}","statuses_url":"https://api.github.com/repos/dailymotion/hls.js/statuses/{sha}","languages_url":"https://api.github.com/repos/dailymotion/hls.js/languages","stargazers_url":"https://api.github.com/repos/dailymotion/hls.js/stargazers","contributors_url":"https://api.github.com/repos/dailymotion/hls.js/contributors","subscribers_url":"https://api.github.com/repos/dailymotion/hls.js/subscribers","subscription_url":"https://api.github.com/repos/dailymotion/hls.js/subscription","commits_url":"https://api.github.com/repos/dailymotion/hls.js/commits{/sha}","git_commits_url":"https://api.github.com/repos/dailymotion/hls.js/git/commits{/sha}","comments_url":"https://api.github.com/repos/dailymotion/hls.js/comments{/number}","issue_comment_url":"https://api.github.com/repos/dailymotion/hls.js/issues/comments{/number}","contents_url":"https://api.github.com/repos/dailymotion/hls.js/contents/{+path}","compare_url":"https://api.github.com/repos/dailymotion/hls.js/compare/{base}...{head}","merges_url":"https://api.github.com/repos/dailymotion/hls.js/merges","archive_url":"https://api.github.com/repos/dailymotion/hls.js/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/dailymotion/hls.js/downloads","issues_url":"https://api.github.com/repos/dailymotion/hls.js/issues{/number}","pulls_url":"https://api.github.com/repos/dailymotion/hls.js/pulls{/number}","milestones_url":"https://api.github.com/repos/dailymotion/hls.js/milestones{/number}","notifications_url":"https://api.github.com/repos/dailymotion/hls.js/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/dailymotion/hls.js/labels{/name}","releases_url":"https://api.github.com/repos/dailymotion/hls.js/releases{/id}","deployments_url":"https://api.github.com/repos/dailymotion/hls.js/deployments","created_at":"2015-01-30T09:06:27Z","updated_at":"2016-07-22T07:13:23Z","pushed_at":"2016-07-21T20:02:31Z","git_url":"git://github.com/dailymotion/hls.js.git","ssh_url":"git@github.com:dailymotion/hls.js.git","clone_url":"https://github.com/dailymotion/hls.js.git","svn_url":"https://github.com/dailymotion/hls.js","homepage":"","size":13215,"stargazers_count":958,"watchers_count":958,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":240,"mirror_url":null,"open_issues_count":170,"forks":240,"open_issues":170,"watchers":958,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/dailymotion/hls.js/pulls/587"},"html":{"href":"https://github.com/dailymotion/hls.js/pull/587"},"issue":{"href":"https://api.github.com/repos/dailymotion/hls.js/issues/587"},"comments":{"href":"https://api.github.com/repos/dailymotion/hls.js/issues/587/comments"},"review_comments":{"href":"https://api.github.com/repos/dailymotion/hls.js/pulls/587/comments"},"review_comment":{"href":"https://api.github.com/repos/dailymotion/hls.js/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/dailymotion/hls.js/pulls/587/commits"},"statuses":{"href":"https://api.github.com/repos/dailymotion/hls.js/statuses/9df1385282ba8efbc765b5175780449dfcc6134a"}}}}
{"actor":{"display_login":"AxelDelmas"}}