{"action":"created","issue":{"url":"https://api.github.com/repos/jwplayer/jwplayer/issues/2762","repository_url":"https://api.github.com/repos/jwplayer/jwplayer","labels_url":"https://api.github.com/repos/jwplayer/jwplayer/issues/2762/labels{/name}","comments_url":"https://api.github.com/repos/jwplayer/jwplayer/issues/2762/comments","events_url":"https://api.github.com/repos/jwplayer/jwplayer/issues/2762/events","html_url":"https://github.com/jwplayer/jwplayer/pull/2762","id":302513013,"number":2762,"title":"Background load the next playlist item","user":{"login":"johnBartos","id":5042276,"avatar_url":"https://avatars1.githubusercontent.com/u/5042276?v=4","gravatar_id":"","url":"https://api.github.com/users/johnBartos","html_url":"https://github.com/johnBartos","followers_url":"https://api.github.com/users/johnBartos/followers","following_url":"https://api.github.com/users/johnBartos/following{/other_user}","gists_url":"https://api.github.com/users/johnBartos/gists{/gist_id}","starred_url":"https://api.github.com/users/johnBartos/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/johnBartos/subscriptions","organizations_url":"https://api.github.com/users/johnBartos/orgs","repos_url":"https://api.github.com/users/johnBartos/repos","events_url":"https://api.github.com/users/johnBartos/events{/privacy}","received_events_url":"https://api.github.com/users/johnBartos/received_events","type":"User","site_admin":false},"labels":[{"id":89434458,"url":"https://api.github.com/repos/jwplayer/jwplayer/labels/enhancement","name":"enhancement","color":"84b6eb","default":true},{"id":226546376,"url":"https://api.github.com/repos/jwplayer/jwplayer/labels/needs-review","name":"needs-review","color":"ededed","default":false}],"state":"open","locked":false,"assignee":{"login":"robwalch","id":333258,"avatar_url":"https://avatars1.githubusercontent.com/u/333258?v=4","gravatar_id":"","url":"https://api.github.com/users/robwalch","html_url":"https://github.com/robwalch","followers_url":"https://api.github.com/users/robwalch/followers","following_url":"https://api.github.com/users/robwalch/following{/other_user}","gists_url":"https://api.github.com/users/robwalch/gists{/gist_id}","starred_url":"https://api.github.com/users/robwalch/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/robwalch/subscriptions","organizations_url":"https://api.github.com/users/robwalch/orgs","repos_url":"https://api.github.com/users/robwalch/repos","events_url":"https://api.github.com/users/robwalch/events{/privacy}","received_events_url":"https://api.github.com/users/robwalch/received_events","type":"User","site_admin":false},"assignees":[{"login":"robwalch","id":333258,"avatar_url":"https://avatars1.githubusercontent.com/u/333258?v=4","gravatar_id":"","url":"https://api.github.com/users/robwalch","html_url":"https://github.com/robwalch","followers_url":"https://api.github.com/users/robwalch/followers","following_url":"https://api.github.com/users/robwalch/following{/other_user}","gists_url":"https://api.github.com/users/robwalch/gists{/gist_id}","starred_url":"https://api.github.com/users/robwalch/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/robwalch/subscriptions","organizations_url":"https://api.github.com/users/robwalch/orgs","repos_url":"https://api.github.com/users/robwalch/repos","events_url":"https://api.github.com/users/robwalch/events{/privacy}","received_events_url":"https://api.github.com/users/robwalch/received_events","type":"User","site_admin":false}],"milestone":{"url":"https://api.github.com/repos/jwplayer/jwplayer/milestones/76","html_url":"https://github.com/jwplayer/jwplayer/milestone/76","labels_url":"https://api.github.com/repos/jwplayer/jwplayer/milestones/76/labels","id":3055473,"number":76,"title":"v8.2.0","description":null,"creator":{"login":"robwalch","id":333258,"avatar_url":"https://avatars1.githubusercontent.com/u/333258?v=4","gravatar_id":"","url":"https://api.github.com/users/robwalch","html_url":"https://github.com/robwalch","followers_url":"https://api.github.com/users/robwalch/followers","following_url":"https://api.github.com/users/robwalch/following{/other_user}","gists_url":"https://api.github.com/users/robwalch/gists{/gist_id}","starred_url":"https://api.github.com/users/robwalch/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/robwalch/subscriptions","organizations_url":"https://api.github.com/users/robwalch/orgs","repos_url":"https://api.github.com/users/robwalch/repos","events_url":"https://api.github.com/users/robwalch/events{/privacy}","received_events_url":"https://api.github.com/users/robwalch/received_events","type":"User","site_admin":false},"open_issues":5,"closed_issues":26,"state":"open","created_at":"2018-01-22T21:32:40Z","updated_at":"2018-03-07T14:31:20Z","due_on":null,"closed_at":null},"comments":2,"created_at":"2018-03-06T00:06:56Z","updated_at":"2018-03-07T21:23:45Z","closed_at":null,"author_association":"MEMBER","pull_request":{"url":"https://api.github.com/repos/jwplayer/jwplayer/pulls/2762","html_url":"https://github.com/jwplayer/jwplayer/pull/2762","diff_url":"https://github.com/jwplayer/jwplayer/pull/2762.diff","patch_url":"https://github.com/jwplayer/jwplayer/pull/2762.patch"},"body":"### This PR will...\r\n- Background load the next item 2 seconds before the end of a video\r\n- Update unit tests\r\n- Refactors code\r\n\r\n### Why is this Pull Request needed?\r\nTo reduce or eliminate the buffering time between subsequent playlist items.\r\n\r\nThis solution (with the `adPlaying`) flag is necessary to avoid a race condition. The race condition appears when placing background loading item into the foreground; this is an async operation, and if the promise resolves while an ad is playing, that video is placed into the DOM. This flag ensures that if we have entered ad playback during this operation we instead place the background loading video into the `loadedMedia` property, which contains media frozen during ad playback. When the ad is over `restoreBackgroundMedia` is called, which places whatever `loadedMedia` is into the background.\r\n\r\n### Is there anything left to do?\r\n- Remove buffering events between item switches when the next item is sufficiently buffered\r\n\r\nI had a commit for this but the removal of buffering makes the `IDLE` state appear between items. This is worse.\r\n\r\n- Apply race condition resolution to the \"regular\" case of loading a new media controller\r\n\r\nThis is also an async operation, and while much harder to reproduce, is theoretically possible. \r\n\r\n### Are there any points in the code the reviewer needs to double check?\r\nAre there any gaps in unit tests which would be worth filling?\r\n\r\n### Are there any Pull Requests open in other repos which need to be merged with this?\r\nhttps://github.com/jwplayer/jwplayer-commercial/pull/4850\r\n\r\n#### Addresses Issue(s):\r\n\r\nJW8-30\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/jwplayer/jwplayer/issues/comments/371289563","html_url":"https://github.com/jwplayer/jwplayer/pull/2762#issuecomment-371289563","issue_url":"https://api.github.com/repos/jwplayer/jwplayer/issues/2762","id":371289563,"user":{"login":"jwplayer-robot","id":5805482,"avatar_url":"https://avatars3.githubusercontent.com/u/5805482?v=4","gravatar_id":"","url":"https://api.github.com/users/jwplayer-robot","html_url":"https://github.com/jwplayer-robot","followers_url":"https://api.github.com/users/jwplayer-robot/followers","following_url":"https://api.github.com/users/jwplayer-robot/following{/other_user}","gists_url":"https://api.github.com/users/jwplayer-robot/gists{/gist_id}","starred_url":"https://api.github.com/users/jwplayer-robot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jwplayer-robot/subscriptions","organizations_url":"https://api.github.com/users/jwplayer-robot/orgs","repos_url":"https://api.github.com/users/jwplayer-robot/repos","events_url":"https://api.github.com/users/jwplayer-robot/events{/privacy}","received_events_url":"https://api.github.com/users/jwplayer-robot/received_events","type":"User","site_admin":false},"created_at":"2018-03-07T21:23:45Z","updated_at":"2018-03-07T21:23:45Z","author_association":"NONE","body":"[:x:](http://jenkins.jwplayer.com/job/jw7-pr-builder-opensource/3510/) Build for commit 95da6c41031d915cf5a21536bbf554221cb67653 failed.\n[:building_construction:](https://jenkins.jwplayer.com/view/JW7/job/jw7-opensource/5631/) jwplayer build SUCCESS\n[:building_construction:](https://jenkins.jwplayer.com/view/JW7/job/jw7-opensource-unit-tests/3525/) jwplayer browserstack tests SUCCESS\n[:building_construction:](https://jenkins.jwplayer.com/view/JW7/job/jw7-commercial/13548/) jwplayer-commercial build SUCCESS\n[:building_construction:](https://jenkins.jwplayer.com/view/JW7/job/jw7-commercial-unit-tests/14029/) jwplayer-commercial browserstack tests SUCCESS\n[:cucumber:](https://jenkins.jwplayer.com/view/JW7/job/jw7-commercial-cucumber/11266/allure/) Automated Tests UNSTABLE\n[:eggplant:](http://player-pr-test-jenkins.longtailvideo.com/builds/13548/archive/test/squash/) Manual Tests\n[:tv:](http://player-pr-test-jenkins.longtailvideo.com/builds/13548/archive/test/view/) Views\n"}}
{"actor":{"display_login":"jwplayer-robot"}}