{"action":"created","comment":{"url":"https://api.github.com/repos/videojs/video.js/pulls/comments/46748692","id":46748692,"diff_hunk":"@@ -105,7 +97,17 @@ class ChaptersButton extends TextTrackButton {\n       }));\n     }\n \n-    if (chaptersTrack) {\n+    if (chaptersTrack && chaptersTrack.cues == null) {\n+      chaptersTrack['mode'] = 'hidden';\n+\n+      let remoteTextTrackEl = this.player_.remoteTextTrackEls().getTrackElementByTrack_(chaptersTrack);","path":"src/js/control-bar/text-track-controls/chapters-button.js","position":35,"original_position":35,"commit_id":"6bbe8fb12117db4e445227a4793a290513f6343a","original_commit_id":"6bbe8fb12117db4e445227a4793a290513f6343a","user":{"login":"gkatsev","id":535884,"avatar_url":"https://avatars.githubusercontent.com/u/535884?v=3","gravatar_id":"","url":"https://api.github.com/users/gkatsev","html_url":"https://github.com/gkatsev","followers_url":"https://api.github.com/users/gkatsev/followers","following_url":"https://api.github.com/users/gkatsev/following{/other_user}","gists_url":"https://api.github.com/users/gkatsev/gists{/gist_id}","starred_url":"https://api.github.com/users/gkatsev/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gkatsev/subscriptions","organizations_url":"https://api.github.com/users/gkatsev/orgs","repos_url":"https://api.github.com/users/gkatsev/repos","events_url":"https://api.github.com/users/gkatsev/events{/privacy}","received_events_url":"https://api.github.com/users/gkatsev/received_events","type":"User","site_admin":false},"body":"looks like there an issue here tracks that were added in the html:\r\n```html\r\n  <video id=\"vid1\" class=\"video-js vjs-default-skin\" controls preload=\"auto\" width=\"640\" height=\"264\"\r\n      poster=\"http://video-js.zencoder.com/oceans-clip.png\">\r\n    <source src=\"oceans-clip.mp4\" type='video/mp4'>\r\n    <source src=\"http://video-js.zencoder.com/oceans-clip.mp4?fo23\" type='video/mp4'>\r\n    <track kind=\"chapters\" src=\"../docs/examples/shared/example-captions.vtt\" srclang=\"en\" label=\"Subs\"></track>\r\n</video>\r\n```\r\nWhat happens here is that we get the chapters track but when we try to retrieve its associated track el, we get undefined so the chapters button never loads.\r\nI think what we need to do is in [`proxyNativeTextTracks_`](https://github.com/videojs/video.js/blob/a601fbb83fdc442f30f09ca15ff55b04c3e7c91d/src/js/tech/html5.js#L254) to loop through any track elements and add them to the remoteTextTrackEls list. And then in [`addRemoteTextTrack`](https://github.com/videojs/video.js/blob/a601fbb83fdc442f30f09ca15ff55b04c3e7c91d/src/js/tech/html5.js#L760) we need to make sure the track el gets added to the list. We also want to make sure that `remoteRemoteTextTrack` removes the associated el.\r\n`html-track-element-list` might need to get updated to support this but hopefully it'll just work.","created_at":"2015-12-05T00:28:38Z","updated_at":"2015-12-05T00:28:38Z","html_url":"https://github.com/videojs/video.js/pull/2804#discussion_r46748692","pull_request_url":"https://api.github.com/repos/videojs/video.js/pulls/2804","_links":{"self":{"href":"https://api.github.com/repos/videojs/video.js/pulls/comments/46748692"},"html":{"href":"https://github.com/videojs/video.js/pull/2804#discussion_r46748692"},"pull_request":{"href":"https://api.github.com/repos/videojs/video.js/pulls/2804"}}},"pull_request":{"url":"https://api.github.com/repos/videojs/video.js/pulls/2804","id":50342890,"html_url":"https://github.com/videojs/video.js/pull/2804","diff_url":"https://github.com/videojs/video.js/pull/2804.diff","patch_url":"https://github.com/videojs/video.js/pull/2804.patch","issue_url":"https://api.github.com/repos/videojs/video.js/issues/2804","number":2804,"state":"open","locked":false,"title":"Emulate HTMLTrackElement to enable load event.","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":"Figure out when track elements are loaded so we can manipulate cues without having to do setTimeout hacks.\r\n\r\nAddresses https://github.com/videojs/video.js/issues/2784.\r\n\r\nAlso addresses (maybe) https://github.com/videojs/video.js/issues/2799.","created_at":"2015-11-11T03:02:27Z","updated_at":"2015-12-05T00:28:38Z","closed_at":null,"merged_at":null,"merge_commit_sha":"df680aff66d30c31c7989b0cfbc0faa90ebe9b41","assignee":{"login":"gkatsev","id":535884,"avatar_url":"https://avatars.githubusercontent.com/u/535884?v=3","gravatar_id":"","url":"https://api.github.com/users/gkatsev","html_url":"https://github.com/gkatsev","followers_url":"https://api.github.com/users/gkatsev/followers","following_url":"https://api.github.com/users/gkatsev/following{/other_user}","gists_url":"https://api.github.com/users/gkatsev/gists{/gist_id}","starred_url":"https://api.github.com/users/gkatsev/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gkatsev/subscriptions","organizations_url":"https://api.github.com/users/gkatsev/orgs","repos_url":"https://api.github.com/users/gkatsev/repos","events_url":"https://api.github.com/users/gkatsev/events{/privacy}","received_events_url":"https://api.github.com/users/gkatsev/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/videojs/video.js/pulls/2804/commits","review_comments_url":"https://api.github.com/repos/videojs/video.js/pulls/2804/comments","review_comment_url":"https://api.github.com/repos/videojs/video.js/pulls/comments{/number}","comments_url":"https://api.github.com/repos/videojs/video.js/issues/2804/comments","statuses_url":"https://api.github.com/repos/videojs/video.js/statuses/6bbe8fb12117db4e445227a4793a290513f6343a","head":{"label":"chemoish:feature/text-track-element","ref":"feature/text-track-element","sha":"6bbe8fb12117db4e445227a4793a290513f6343a","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":40019264,"name":"video.js","full_name":"chemoish/video.js","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/video.js","description":"Video.js - open source HTML5 & Flash video player","fork":true,"url":"https://api.github.com/repos/chemoish/video.js","forks_url":"https://api.github.com/repos/chemoish/video.js/forks","keys_url":"https://api.github.com/repos/chemoish/video.js/keys{/key_id}","collaborators_url":"https://api.github.com/repos/chemoish/video.js/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/chemoish/video.js/teams","hooks_url":"https://api.github.com/repos/chemoish/video.js/hooks","issue_events_url":"https://api.github.com/repos/chemoish/video.js/issues/events{/number}","events_url":"https://api.github.com/repos/chemoish/video.js/events","assignees_url":"https://api.github.com/repos/chemoish/video.js/assignees{/user}","branches_url":"https://api.github.com/repos/chemoish/video.js/branches{/branch}","tags_url":"https://api.github.com/repos/chemoish/video.js/tags","blobs_url":"https://api.github.com/repos/chemoish/video.js/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/chemoish/video.js/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/chemoish/video.js/git/refs{/sha}","trees_url":"https://api.github.com/repos/chemoish/video.js/git/trees{/sha}","statuses_url":"https://api.github.com/repos/chemoish/video.js/statuses/{sha}","languages_url":"https://api.github.com/repos/chemoish/video.js/languages","stargazers_url":"https://api.github.com/repos/chemoish/video.js/stargazers","contributors_url":"https://api.github.com/repos/chemoish/video.js/contributors","subscribers_url":"https://api.github.com/repos/chemoish/video.js/subscribers","subscription_url":"https://api.github.com/repos/chemoish/video.js/subscription","commits_url":"https://api.github.com/repos/chemoish/video.js/commits{/sha}","git_commits_url":"https://api.github.com/repos/chemoish/video.js/git/commits{/sha}","comments_url":"https://api.github.com/repos/chemoish/video.js/comments{/number}","issue_comment_url":"https://api.github.com/repos/chemoish/video.js/issues/comments{/number}","contents_url":"https://api.github.com/repos/chemoish/video.js/contents/{+path}","compare_url":"https://api.github.com/repos/chemoish/video.js/compare/{base}...{head}","merges_url":"https://api.github.com/repos/chemoish/video.js/merges","archive_url":"https://api.github.com/repos/chemoish/video.js/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/chemoish/video.js/downloads","issues_url":"https://api.github.com/repos/chemoish/video.js/issues{/number}","pulls_url":"https://api.github.com/repos/chemoish/video.js/pulls{/number}","milestones_url":"https://api.github.com/repos/chemoish/video.js/milestones{/number}","notifications_url":"https://api.github.com/repos/chemoish/video.js/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/chemoish/video.js/labels{/name}","releases_url":"https://api.github.com/repos/chemoish/video.js/releases{/id}","created_at":"2015-07-31T18:30:05Z","updated_at":"2015-07-31T18:30:07Z","pushed_at":"2015-11-20T20:01:09Z","git_url":"git://github.com/chemoish/video.js.git","ssh_url":"git@github.com:chemoish/video.js.git","clone_url":"https://github.com/chemoish/video.js.git","svn_url":"https://github.com/chemoish/video.js","homepage":"www.videojs.com","size":39722,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_downloads":false,"has_wiki":true,"has_pages":true,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"videojs:master","ref":"master","sha":"6bbd6f1a65d49566900a6d52979d4c9e10ea7fc4","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":667006,"name":"video.js","full_name":"videojs/video.js","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/video.js","description":"Video.js - open source HTML5 & Flash video player","fork":false,"url":"https://api.github.com/repos/videojs/video.js","forks_url":"https://api.github.com/repos/videojs/video.js/forks","keys_url":"https://api.github.com/repos/videojs/video.js/keys{/key_id}","collaborators_url":"https://api.github.com/repos/videojs/video.js/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/videojs/video.js/teams","hooks_url":"https://api.github.com/repos/videojs/video.js/hooks","issue_events_url":"https://api.github.com/repos/videojs/video.js/issues/events{/number}","events_url":"https://api.github.com/repos/videojs/video.js/events","assignees_url":"https://api.github.com/repos/videojs/video.js/assignees{/user}","branches_url":"https://api.github.com/repos/videojs/video.js/branches{/branch}","tags_url":"https://api.github.com/repos/videojs/video.js/tags","blobs_url":"https://api.github.com/repos/videojs/video.js/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/videojs/video.js/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/videojs/video.js/git/refs{/sha}","trees_url":"https://api.github.com/repos/videojs/video.js/git/trees{/sha}","statuses_url":"https://api.github.com/repos/videojs/video.js/statuses/{sha}","languages_url":"https://api.github.com/repos/videojs/video.js/languages","stargazers_url":"https://api.github.com/repos/videojs/video.js/stargazers","contributors_url":"https://api.github.com/repos/videojs/video.js/contributors","subscribers_url":"https://api.github.com/repos/videojs/video.js/subscribers","subscription_url":"https://api.github.com/repos/videojs/video.js/subscription","commits_url":"https://api.github.com/repos/videojs/video.js/commits{/sha}","git_commits_url":"https://api.github.com/repos/videojs/video.js/git/commits{/sha}","comments_url":"https://api.github.com/repos/videojs/video.js/comments{/number}","issue_comment_url":"https://api.github.com/repos/videojs/video.js/issues/comments{/number}","contents_url":"https://api.github.com/repos/videojs/video.js/contents/{+path}","compare_url":"https://api.github.com/repos/videojs/video.js/compare/{base}...{head}","merges_url":"https://api.github.com/repos/videojs/video.js/merges","archive_url":"https://api.github.com/repos/videojs/video.js/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/videojs/video.js/downloads","issues_url":"https://api.github.com/repos/videojs/video.js/issues{/number}","pulls_url":"https://api.github.com/repos/videojs/video.js/pulls{/number}","milestones_url":"https://api.github.com/repos/videojs/video.js/milestones{/number}","notifications_url":"https://api.github.com/repos/videojs/video.js/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/videojs/video.js/labels{/name}","releases_url":"https://api.github.com/repos/videojs/video.js/releases{/id}","created_at":"2010-05-14T18:45:10Z","updated_at":"2015-12-04T20:43:25Z","pushed_at":"2015-12-04T20:47:34Z","git_url":"git://github.com/videojs/video.js.git","ssh_url":"git@github.com:videojs/video.js.git","clone_url":"https://github.com/videojs/video.js.git","svn_url":"https://github.com/videojs/video.js","homepage":"www.videojs.com","size":77980,"stargazers_count":11065,"watchers_count":11065,"language":"JavaScript","has_issues":true,"has_downloads":false,"has_wiki":true,"has_pages":true,"forks_count":3207,"mirror_url":null,"open_issues_count":212,"forks":3207,"open_issues":212,"watchers":11065,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/videojs/video.js/pulls/2804"},"html":{"href":"https://github.com/videojs/video.js/pull/2804"},"issue":{"href":"https://api.github.com/repos/videojs/video.js/issues/2804"},"comments":{"href":"https://api.github.com/repos/videojs/video.js/issues/2804/comments"},"review_comments":{"href":"https://api.github.com/repos/videojs/video.js/pulls/2804/comments"},"review_comment":{"href":"https://api.github.com/repos/videojs/video.js/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/videojs/video.js/pulls/2804/commits"},"statuses":{"href":"https://api.github.com/repos/videojs/video.js/statuses/6bbe8fb12117db4e445227a4793a290513f6343a"}}}}