{"action":"created","comment":{"url":"https://api.github.com/repos/videojs/http-streaming/pulls/comments/224884187","pull_request_review_id":164368358,"id":224884187,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIyNDg4NDE4Nw==","diff_hunk":"@@ -0,0 +1,76 @@\n+/**\n+ * @file time.js\n+ */\n+\n+const findSegmentForTime = (time, timeline) => {\n+  const matchingSegments = timeline.filter((x) => {\n+    return x.start <= time && time <= x.end;\n+  });\n+\n+  if (matchingSegments.length === 0) {\n+    return null;\n+  }\n+\n+  return matchingSegments[0].segment;\n+};\n+\n+const buildMediaTimeline = (playlist) => {\n+  const timeline = [];\n+\n+  if (!playlist.segments || playlist.segments.length === 0) {\n+    return;\n+  }\n+\n+  // Assumptions:\n+  // - there will always be a segment.duration\n+  // - we can start from zero\n+  // - segments are in time order\n+  // - segment.start and segment.end only come\n+  //    from syncController(ignored for now)\n+\n+  let time = 0;\n+\n+  playlist.segments.forEach((segment) => {\n+    const end = time + segment.duration;\n+\n+    timeline.push({\n+      start: time,\n+      end,\n+      segment\n+    });\n+\n+    time = end;\n+  });\n+\n+  return timeline;\n+};\n+\n+export const getStreamTime = (player, masterPlaylistController) => {","path":"src/util/time.js","position":48,"original_position":48,"commit_id":"95ee7c0014698941d344e9a89c4b51fc9dcf7a20","original_commit_id":"95ee7c0014698941d344e9a89c4b51fc9dcf7a20","user":{"login":"gesinger","id":356726,"node_id":"MDQ6VXNlcjM1NjcyNg==","avatar_url":"https://avatars1.githubusercontent.com/u/356726?v=4","gravatar_id":"","url":"https://api.github.com/users/gesinger","html_url":"https://github.com/gesinger","followers_url":"https://api.github.com/users/gesinger/followers","following_url":"https://api.github.com/users/gesinger/following{/other_user}","gists_url":"https://api.github.com/users/gesinger/gists{/gist_id}","starred_url":"https://api.github.com/users/gesinger/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gesinger/subscriptions","organizations_url":"https://api.github.com/users/gesinger/orgs","repos_url":"https://api.github.com/users/gesinger/repos","events_url":"https://api.github.com/users/gesinger/events{/privacy}","received_events_url":"https://api.github.com/users/gesinger/received_events","type":"User","site_admin":false},"body":"Probably should just pass the playlist here instead of MPC.","created_at":"2018-10-12T18:53:26Z","updated_at":"2018-10-12T18:57:25Z","html_url":"https://github.com/videojs/http-streaming/pull/257#discussion_r224884187","pull_request_url":"https://api.github.com/repos/videojs/http-streaming/pulls/257","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/videojs/http-streaming/pulls/comments/224884187"},"html":{"href":"https://github.com/videojs/http-streaming/pull/257#discussion_r224884187"},"pull_request":{"href":"https://api.github.com/repos/videojs/http-streaming/pulls/257"}}},"pull_request":{"url":"https://api.github.com/repos/videojs/http-streaming/pulls/257","id":222306991,"node_id":"MDExOlB1bGxSZXF1ZXN0MjIyMzA2OTkx","html_url":"https://github.com/videojs/http-streaming/pull/257","diff_url":"https://github.com/videojs/http-streaming/pull/257.diff","patch_url":"https://github.com/videojs/http-streaming/pull/257.patch","issue_url":"https://api.github.com/repos/videojs/http-streaming/issues/257","number":257,"state":"open","locked":false,"title":"[WIP] convertToStreamTime method","user":{"login":"ldayananda","id":3826638,"node_id":"MDQ6VXNlcjM4MjY2Mzg=","avatar_url":"https://avatars2.githubusercontent.com/u/3826638?v=4","gravatar_id":"","url":"https://api.github.com/users/ldayananda","html_url":"https://github.com/ldayananda","followers_url":"https://api.github.com/users/ldayananda/followers","following_url":"https://api.github.com/users/ldayananda/following{/other_user}","gists_url":"https://api.github.com/users/ldayananda/gists{/gist_id}","starred_url":"https://api.github.com/users/ldayananda/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ldayananda/subscriptions","organizations_url":"https://api.github.com/users/ldayananda/orgs","repos_url":"https://api.github.com/users/ldayananda/repos","events_url":"https://api.github.com/users/ldayananda/events{/privacy}","received_events_url":"https://api.github.com/users/ldayananda/received_events","type":"User","site_admin":false},"body":"## Description\r\nPlease describe the change as necessary.\r\nIf it's a feature or enhancement please be as detailed as possible.\r\nIf it's a bug fix, please link the issue that it fixes or describe the bug in as much detail.\r\n\r\n## Specific Changes proposed\r\nPlease list the specific changes involved in this pull request.\r\n\r\n## Requirements Checklist\r\n- [ ] Feature implemented / Bug fixed\r\n- [ ] If necessary, more likely in a feature request than a bug fix\r\n  - [ ] Unit Tests updated or fixed\r\n  - [ ] Docs/guides updated\r\n  - [ ] Example created ([starter template on JSBin](https://jsbin.com/gejugat/edit?html,output))\r\n- [ ] Reviewed by Two Core Contributors\r\n","created_at":"2018-10-11T23:16:28Z","updated_at":"2018-10-12T18:57:25Z","closed_at":null,"merged_at":null,"merge_commit_sha":"b414f1722456e2fa4f871d4126c477db6feca2d4","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/videojs/http-streaming/pulls/257/commits","review_comments_url":"https://api.github.com/repos/videojs/http-streaming/pulls/257/comments","review_comment_url":"https://api.github.com/repos/videojs/http-streaming/pulls/comments{/number}","comments_url":"https://api.github.com/repos/videojs/http-streaming/issues/257/comments","statuses_url":"https://api.github.com/repos/videojs/http-streaming/statuses/95ee7c0014698941d344e9a89c4b51fc9dcf7a20","head":{"label":"ldayananda:streamtime","ref":"streamtime","sha":"95ee7c0014698941d344e9a89c4b51fc9dcf7a20","user":{"login":"ldayananda","id":3826638,"node_id":"MDQ6VXNlcjM4MjY2Mzg=","avatar_url":"https://avatars2.githubusercontent.com/u/3826638?v=4","gravatar_id":"","url":"https://api.github.com/users/ldayananda","html_url":"https://github.com/ldayananda","followers_url":"https://api.github.com/users/ldayananda/followers","following_url":"https://api.github.com/users/ldayananda/following{/other_user}","gists_url":"https://api.github.com/users/ldayananda/gists{/gist_id}","starred_url":"https://api.github.com/users/ldayananda/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ldayananda/subscriptions","organizations_url":"https://api.github.com/users/ldayananda/orgs","repos_url":"https://api.github.com/users/ldayananda/repos","events_url":"https://api.github.com/users/ldayananda/events{/privacy}","received_events_url":"https://api.github.com/users/ldayananda/received_events","type":"User","site_admin":false},"repo":{"id":128979821,"node_id":"MDEwOlJlcG9zaXRvcnkxMjg5Nzk4MjE=","name":"http-streaming","full_name":"ldayananda/http-streaming","private":false,"owner":{"login":"ldayananda","id":3826638,"node_id":"MDQ6VXNlcjM4MjY2Mzg=","avatar_url":"https://avatars2.githubusercontent.com/u/3826638?v=4","gravatar_id":"","url":"https://api.github.com/users/ldayananda","html_url":"https://github.com/ldayananda","followers_url":"https://api.github.com/users/ldayananda/followers","following_url":"https://api.github.com/users/ldayananda/following{/other_user}","gists_url":"https://api.github.com/users/ldayananda/gists{/gist_id}","starred_url":"https://api.github.com/users/ldayananda/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ldayananda/subscriptions","organizations_url":"https://api.github.com/users/ldayananda/orgs","repos_url":"https://api.github.com/users/ldayananda/repos","events_url":"https://api.github.com/users/ldayananda/events{/privacy}","received_events_url":"https://api.github.com/users/ldayananda/received_events","type":"User","site_admin":false},"html_url":"https://github.com/ldayananda/http-streaming","description":"HLS library for video.js","fork":true,"url":"https://api.github.com/repos/ldayananda/http-streaming","forks_url":"https://api.github.com/repos/ldayananda/http-streaming/forks","keys_url":"https://api.github.com/repos/ldayananda/http-streaming/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ldayananda/http-streaming/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ldayananda/http-streaming/teams","hooks_url":"https://api.github.com/repos/ldayananda/http-streaming/hooks","issue_events_url":"https://api.github.com/repos/ldayananda/http-streaming/issues/events{/number}","events_url":"https://api.github.com/repos/ldayananda/http-streaming/events","assignees_url":"https://api.github.com/repos/ldayananda/http-streaming/assignees{/user}","branches_url":"https://api.github.com/repos/ldayananda/http-streaming/branches{/branch}","tags_url":"https://api.github.com/repos/ldayananda/http-streaming/tags","blobs_url":"https://api.github.com/repos/ldayananda/http-streaming/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ldayananda/http-streaming/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ldayananda/http-streaming/git/refs{/sha}","trees_url":"https://api.github.com/repos/ldayananda/http-streaming/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ldayananda/http-streaming/statuses/{sha}","languages_url":"https://api.github.com/repos/ldayananda/http-streaming/languages","stargazers_url":"https://api.github.com/repos/ldayananda/http-streaming/stargazers","contributors_url":"https://api.github.com/repos/ldayananda/http-streaming/contributors","subscribers_url":"https://api.github.com/repos/ldayananda/http-streaming/subscribers","subscription_url":"https://api.github.com/repos/ldayananda/http-streaming/subscription","commits_url":"https://api.github.com/repos/ldayananda/http-streaming/commits{/sha}","git_commits_url":"https://api.github.com/repos/ldayananda/http-streaming/git/commits{/sha}","comments_url":"https://api.github.com/repos/ldayananda/http-streaming/comments{/number}","issue_comment_url":"https://api.github.com/repos/ldayananda/http-streaming/issues/comments{/number}","contents_url":"https://api.github.com/repos/ldayananda/http-streaming/contents/{+path}","compare_url":"https://api.github.com/repos/ldayananda/http-streaming/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ldayananda/http-streaming/merges","archive_url":"https://api.github.com/repos/ldayananda/http-streaming/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ldayananda/http-streaming/downloads","issues_url":"https://api.github.com/repos/ldayananda/http-streaming/issues{/number}","pulls_url":"https://api.github.com/repos/ldayananda/http-streaming/pulls{/number}","milestones_url":"https://api.github.com/repos/ldayananda/http-streaming/milestones{/number}","notifications_url":"https://api.github.com/repos/ldayananda/http-streaming/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ldayananda/http-streaming/labels{/name}","releases_url":"https://api.github.com/repos/ldayananda/http-streaming/releases{/id}","deployments_url":"https://api.github.com/repos/ldayananda/http-streaming/deployments","created_at":"2018-04-10T18:41:13Z","updated_at":"2018-04-10T18:41:15Z","pushed_at":"2018-10-11T23:15:44Z","git_url":"git://github.com/ldayananda/http-streaming.git","ssh_url":"git@github.com:ldayananda/http-streaming.git","clone_url":"https://github.com/ldayananda/http-streaming.git","svn_url":"https://github.com/ldayananda/http-streaming","homepage":"https://videojs.github.io/http-streaming/","size":16429,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"other","name":"Other","spdx_id":"NOASSERTION","url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"videojs:master","ref":"master","sha":"b8c4d4b0dc2ca2b26c7275107f4c0f8efa3497d7","user":{"login":"videojs","id":3287189,"node_id":"MDEyOk9yZ2FuaXphdGlvbjMyODcxODk=","avatar_url":"https://avatars2.githubusercontent.com/u/3287189?v=4","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":106473768,"node_id":"MDEwOlJlcG9zaXRvcnkxMDY0NzM3Njg=","name":"http-streaming","full_name":"videojs/http-streaming","private":false,"owner":{"login":"videojs","id":3287189,"node_id":"MDEyOk9yZ2FuaXphdGlvbjMyODcxODk=","avatar_url":"https://avatars2.githubusercontent.com/u/3287189?v=4","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},"html_url":"https://github.com/videojs/http-streaming","description":"HLS, DASH, and future HTTP streaming protocols library for video.js","fork":false,"url":"https://api.github.com/repos/videojs/http-streaming","forks_url":"https://api.github.com/repos/videojs/http-streaming/forks","keys_url":"https://api.github.com/repos/videojs/http-streaming/keys{/key_id}","collaborators_url":"https://api.github.com/repos/videojs/http-streaming/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/videojs/http-streaming/teams","hooks_url":"https://api.github.com/repos/videojs/http-streaming/hooks","issue_events_url":"https://api.github.com/repos/videojs/http-streaming/issues/events{/number}","events_url":"https://api.github.com/repos/videojs/http-streaming/events","assignees_url":"https://api.github.com/repos/videojs/http-streaming/assignees{/user}","branches_url":"https://api.github.com/repos/videojs/http-streaming/branches{/branch}","tags_url":"https://api.github.com/repos/videojs/http-streaming/tags","blobs_url":"https://api.github.com/repos/videojs/http-streaming/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/videojs/http-streaming/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/videojs/http-streaming/git/refs{/sha}","trees_url":"https://api.github.com/repos/videojs/http-streaming/git/trees{/sha}","statuses_url":"https://api.github.com/repos/videojs/http-streaming/statuses/{sha}","languages_url":"https://api.github.com/repos/videojs/http-streaming/languages","stargazers_url":"https://api.github.com/repos/videojs/http-streaming/stargazers","contributors_url":"https://api.github.com/repos/videojs/http-streaming/contributors","subscribers_url":"https://api.github.com/repos/videojs/http-streaming/subscribers","subscription_url":"https://api.github.com/repos/videojs/http-streaming/subscription","commits_url":"https://api.github.com/repos/videojs/http-streaming/commits{/sha}","git_commits_url":"https://api.github.com/repos/videojs/http-streaming/git/commits{/sha}","comments_url":"https://api.github.com/repos/videojs/http-streaming/comments{/number}","issue_comment_url":"https://api.github.com/repos/videojs/http-streaming/issues/comments{/number}","contents_url":"https://api.github.com/repos/videojs/http-streaming/contents/{+path}","compare_url":"https://api.github.com/repos/videojs/http-streaming/compare/{base}...{head}","merges_url":"https://api.github.com/repos/videojs/http-streaming/merges","archive_url":"https://api.github.com/repos/videojs/http-streaming/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/videojs/http-streaming/downloads","issues_url":"https://api.github.com/repos/videojs/http-streaming/issues{/number}","pulls_url":"https://api.github.com/repos/videojs/http-streaming/pulls{/number}","milestones_url":"https://api.github.com/repos/videojs/http-streaming/milestones{/number}","notifications_url":"https://api.github.com/repos/videojs/http-streaming/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/videojs/http-streaming/labels{/name}","releases_url":"https://api.github.com/repos/videojs/http-streaming/releases{/id}","deployments_url":"https://api.github.com/repos/videojs/http-streaming/deployments","created_at":"2017-10-10T21:32:54Z","updated_at":"2018-10-12T14:49:34Z","pushed_at":"2018-10-11T23:16:29Z","git_url":"git://github.com/videojs/http-streaming.git","ssh_url":"git@github.com:videojs/http-streaming.git","clone_url":"https://github.com/videojs/http-streaming.git","svn_url":"https://github.com/videojs/http-streaming","homepage":"https://videojs.github.io/http-streaming/","size":16097,"stargazers_count":222,"watchers_count":222,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":38,"mirror_url":null,"archived":false,"open_issues_count":76,"license":{"key":"other","name":"Other","spdx_id":"NOASSERTION","url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":38,"open_issues":76,"watchers":222,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/videojs/http-streaming/pulls/257"},"html":{"href":"https://github.com/videojs/http-streaming/pull/257"},"issue":{"href":"https://api.github.com/repos/videojs/http-streaming/issues/257"},"comments":{"href":"https://api.github.com/repos/videojs/http-streaming/issues/257/comments"},"review_comments":{"href":"https://api.github.com/repos/videojs/http-streaming/pulls/257/comments"},"review_comment":{"href":"https://api.github.com/repos/videojs/http-streaming/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/videojs/http-streaming/pulls/257/commits"},"statuses":{"href":"https://api.github.com/repos/videojs/http-streaming/statuses/95ee7c0014698941d344e9a89c4b51fc9dcf7a20"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"gesinger"}}