{"action":"created","comment":{"url":"https://api.github.com/repos/videogular/videogular/pulls/comments/122597764","pull_request_review_id":44727292,"id":122597764,"diff_hunk":"@@ -362,12 +374,39 @@ angular.module(\"com.2fdevs.videogular\")\n         };\n \n         this.play = function () {\n-            this.mediaElement[0].play();\n+            var mediaElement = this.mediaElement[0];\n+\n+            // short-circuit if already playing\n+            if (playPromise || !mediaElement.paused) {\n+                return;\n+            }\n+\n+            playPromise = mediaElement.play();\n+\n+            if (playPromise && playPromise.then && playPromise.catch) { // browser has async play promise\n+                playPromise\n+                    .then(function() {\n+                        playPromise = null;\n+                    })\n+                    .catch(function() {\n+                        // deliberately empty for the sake of eating console noise\n+                    });\n+            }\n+\n             this.setState(VG_STATES.PLAY);\n         };\n \n         this.pause = function () {\n-            this.mediaElement[0].pause();\n+            var mediaElement = this.mediaElement[0];\n+            \n+            if (playPromise) { // browser has async play promise\n+                playPromise.then(function() {","path":"app/scripts/com/2fdevs/videogular/controllers/vg-controller.js","position":92,"original_position":92,"commit_id":"f80bb28156b3f2de35a287949794a9c9e5bee2b3","original_commit_id":"f80bb28156b3f2de35a287949794a9c9e5bee2b3","user":{"login":"Elecash","id":790704,"avatar_url":"https://avatars0.githubusercontent.com/u/790704?v=3","gravatar_id":"","url":"https://api.github.com/users/Elecash","html_url":"https://github.com/Elecash","followers_url":"https://api.github.com/users/Elecash/followers","following_url":"https://api.github.com/users/Elecash/following{/other_user}","gists_url":"https://api.github.com/users/Elecash/gists{/gist_id}","starred_url":"https://api.github.com/users/Elecash/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Elecash/subscriptions","organizations_url":"https://api.github.com/users/Elecash/orgs","repos_url":"https://api.github.com/users/Elecash/repos","events_url":"https://api.github.com/users/Elecash/events{/privacy}","received_events_url":"https://api.github.com/users/Elecash/received_events","type":"User","site_admin":false},"body":"When you pause the playPromise is executed? I understand that this is to clear the promise? If that's the case then no problem","created_at":"2017-06-18T18:26:21Z","updated_at":"2017-06-18T18:26:21Z","html_url":"https://github.com/videogular/videogular/pull/463#discussion_r122597764","pull_request_url":"https://api.github.com/repos/videogular/videogular/pulls/463","_links":{"self":{"href":"https://api.github.com/repos/videogular/videogular/pulls/comments/122597764"},"html":{"href":"https://github.com/videogular/videogular/pull/463#discussion_r122597764"},"pull_request":{"href":"https://api.github.com/repos/videogular/videogular/pulls/463"}}},"pull_request":{"url":"https://api.github.com/repos/videogular/videogular/pulls/463","id":126083150,"html_url":"https://github.com/videogular/videogular/pull/463","diff_url":"https://github.com/videogular/videogular/pull/463.diff","patch_url":"https://github.com/videogular/videogular/pull/463.patch","issue_url":"https://api.github.com/repos/videogular/videogular/issues/463","number":463,"state":"open","locked":false,"title":"Small fixes + enhancements round 1","user":{"login":"kfeinUI","id":5054750,"avatar_url":"https://avatars2.githubusercontent.com/u/5054750?v=3","gravatar_id":"","url":"https://api.github.com/users/kfeinUI","html_url":"https://github.com/kfeinUI","followers_url":"https://api.github.com/users/kfeinUI/followers","following_url":"https://api.github.com/users/kfeinUI/following{/other_user}","gists_url":"https://api.github.com/users/kfeinUI/gists{/gist_id}","starred_url":"https://api.github.com/users/kfeinUI/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kfeinUI/subscriptions","organizations_url":"https://api.github.com/users/kfeinUI/orgs","repos_url":"https://api.github.com/users/kfeinUI/repos","events_url":"https://api.github.com/users/kfeinUI/events{/privacy}","received_events_url":"https://api.github.com/users/kfeinUI/received_events","type":"User","site_admin":false},"body":"### Description\r\n1. Add input validation to seekTime() to ensure that it only accepts finite numbers.\r\n1. Safer handling of play() and pause() to silence some console noise. Some browsers have async methods and will complain when you interrupt an operation.\r\n1. New _API.activeSource_ to provide convenient access to the applied source. There's presently an event to expose this to the outside, but no convenient way to get to it internally.\r\n1. Fix to the doc comments about expected source input. String not supported.\r\n1. Add support for a new optional _isLive_ flag on the source input object. This allows you to override the built in detection logic, which may not be reliable in all cases such as with playback plugins.","created_at":"2017-06-16T17:52:19Z","updated_at":"2017-06-18T18:26:21Z","closed_at":null,"merged_at":null,"merge_commit_sha":"55ea8643d26977c2373deb63a0d8205963dd8848","assignee":{"login":"Elecash","id":790704,"avatar_url":"https://avatars0.githubusercontent.com/u/790704?v=3","gravatar_id":"","url":"https://api.github.com/users/Elecash","html_url":"https://github.com/Elecash","followers_url":"https://api.github.com/users/Elecash/followers","following_url":"https://api.github.com/users/Elecash/following{/other_user}","gists_url":"https://api.github.com/users/Elecash/gists{/gist_id}","starred_url":"https://api.github.com/users/Elecash/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Elecash/subscriptions","organizations_url":"https://api.github.com/users/Elecash/orgs","repos_url":"https://api.github.com/users/Elecash/repos","events_url":"https://api.github.com/users/Elecash/events{/privacy}","received_events_url":"https://api.github.com/users/Elecash/received_events","type":"User","site_admin":false},"assignees":[{"login":"Elecash","id":790704,"avatar_url":"https://avatars0.githubusercontent.com/u/790704?v=3","gravatar_id":"","url":"https://api.github.com/users/Elecash","html_url":"https://github.com/Elecash","followers_url":"https://api.github.com/users/Elecash/followers","following_url":"https://api.github.com/users/Elecash/following{/other_user}","gists_url":"https://api.github.com/users/Elecash/gists{/gist_id}","starred_url":"https://api.github.com/users/Elecash/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Elecash/subscriptions","organizations_url":"https://api.github.com/users/Elecash/orgs","repos_url":"https://api.github.com/users/Elecash/repos","events_url":"https://api.github.com/users/Elecash/events{/privacy}","received_events_url":"https://api.github.com/users/Elecash/received_events","type":"User","site_admin":false}],"requested_reviewers":[],"milestone":null,"commits_url":"https://api.github.com/repos/videogular/videogular/pulls/463/commits","review_comments_url":"https://api.github.com/repos/videogular/videogular/pulls/463/comments","review_comment_url":"https://api.github.com/repos/videogular/videogular/pulls/comments{/number}","comments_url":"https://api.github.com/repos/videogular/videogular/issues/463/comments","statuses_url":"https://api.github.com/repos/videogular/videogular/statuses/f80bb28156b3f2de35a287949794a9c9e5bee2b3","head":{"label":"kfeinUI:Small_fixes_#1","ref":"Small_fixes_#1","sha":"f80bb28156b3f2de35a287949794a9c9e5bee2b3","user":{"login":"kfeinUI","id":5054750,"avatar_url":"https://avatars2.githubusercontent.com/u/5054750?v=3","gravatar_id":"","url":"https://api.github.com/users/kfeinUI","html_url":"https://github.com/kfeinUI","followers_url":"https://api.github.com/users/kfeinUI/followers","following_url":"https://api.github.com/users/kfeinUI/following{/other_user}","gists_url":"https://api.github.com/users/kfeinUI/gists{/gist_id}","starred_url":"https://api.github.com/users/kfeinUI/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kfeinUI/subscriptions","organizations_url":"https://api.github.com/users/kfeinUI/orgs","repos_url":"https://api.github.com/users/kfeinUI/repos","events_url":"https://api.github.com/users/kfeinUI/events{/privacy}","received_events_url":"https://api.github.com/users/kfeinUI/received_events","type":"User","site_admin":false},"repo":{"id":40012446,"name":"videogular","full_name":"kfeinUI/videogular","owner":{"login":"kfeinUI","id":5054750,"avatar_url":"https://avatars2.githubusercontent.com/u/5054750?v=3","gravatar_id":"","url":"https://api.github.com/users/kfeinUI","html_url":"https://github.com/kfeinUI","followers_url":"https://api.github.com/users/kfeinUI/followers","following_url":"https://api.github.com/users/kfeinUI/following{/other_user}","gists_url":"https://api.github.com/users/kfeinUI/gists{/gist_id}","starred_url":"https://api.github.com/users/kfeinUI/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kfeinUI/subscriptions","organizations_url":"https://api.github.com/users/kfeinUI/orgs","repos_url":"https://api.github.com/users/kfeinUI/repos","events_url":"https://api.github.com/users/kfeinUI/events{/privacy}","received_events_url":"https://api.github.com/users/kfeinUI/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/kfeinUI/videogular","description":"The HTML5 video player for AngularJS","fork":true,"url":"https://api.github.com/repos/kfeinUI/videogular","forks_url":"https://api.github.com/repos/kfeinUI/videogular/forks","keys_url":"https://api.github.com/repos/kfeinUI/videogular/keys{/key_id}","collaborators_url":"https://api.github.com/repos/kfeinUI/videogular/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/kfeinUI/videogular/teams","hooks_url":"https://api.github.com/repos/kfeinUI/videogular/hooks","issue_events_url":"https://api.github.com/repos/kfeinUI/videogular/issues/events{/number}","events_url":"https://api.github.com/repos/kfeinUI/videogular/events","assignees_url":"https://api.github.com/repos/kfeinUI/videogular/assignees{/user}","branches_url":"https://api.github.com/repos/kfeinUI/videogular/branches{/branch}","tags_url":"https://api.github.com/repos/kfeinUI/videogular/tags","blobs_url":"https://api.github.com/repos/kfeinUI/videogular/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/kfeinUI/videogular/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/kfeinUI/videogular/git/refs{/sha}","trees_url":"https://api.github.com/repos/kfeinUI/videogular/git/trees{/sha}","statuses_url":"https://api.github.com/repos/kfeinUI/videogular/statuses/{sha}","languages_url":"https://api.github.com/repos/kfeinUI/videogular/languages","stargazers_url":"https://api.github.com/repos/kfeinUI/videogular/stargazers","contributors_url":"https://api.github.com/repos/kfeinUI/videogular/contributors","subscribers_url":"https://api.github.com/repos/kfeinUI/videogular/subscribers","subscription_url":"https://api.github.com/repos/kfeinUI/videogular/subscription","commits_url":"https://api.github.com/repos/kfeinUI/videogular/commits{/sha}","git_commits_url":"https://api.github.com/repos/kfeinUI/videogular/git/commits{/sha}","comments_url":"https://api.github.com/repos/kfeinUI/videogular/comments{/number}","issue_comment_url":"https://api.github.com/repos/kfeinUI/videogular/issues/comments{/number}","contents_url":"https://api.github.com/repos/kfeinUI/videogular/contents/{+path}","compare_url":"https://api.github.com/repos/kfeinUI/videogular/compare/{base}...{head}","merges_url":"https://api.github.com/repos/kfeinUI/videogular/merges","archive_url":"https://api.github.com/repos/kfeinUI/videogular/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/kfeinUI/videogular/downloads","issues_url":"https://api.github.com/repos/kfeinUI/videogular/issues{/number}","pulls_url":"https://api.github.com/repos/kfeinUI/videogular/pulls{/number}","milestones_url":"https://api.github.com/repos/kfeinUI/videogular/milestones{/number}","notifications_url":"https://api.github.com/repos/kfeinUI/videogular/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/kfeinUI/videogular/labels{/name}","releases_url":"https://api.github.com/repos/kfeinUI/videogular/releases{/id}","deployments_url":"https://api.github.com/repos/kfeinUI/videogular/deployments","created_at":"2015-07-31T15:44:03Z","updated_at":"2017-04-24T17:54:46Z","pushed_at":"2017-06-16T17:44:48Z","git_url":"git://github.com/kfeinUI/videogular.git","ssh_url":"git@github.com:kfeinUI/videogular.git","clone_url":"https://github.com/kfeinUI/videogular.git","svn_url":"https://github.com/kfeinUI/videogular","homepage":"http://www.videogular.com","size":146899,"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,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"videogular:master","ref":"master","sha":"2918cef3540e5db1cfdd0ae26f64aebfd43b97d9","user":{"login":"videogular","id":15369882,"avatar_url":"https://avatars2.githubusercontent.com/u/15369882?v=3","gravatar_id":"","url":"https://api.github.com/users/videogular","html_url":"https://github.com/videogular","followers_url":"https://api.github.com/users/videogular/followers","following_url":"https://api.github.com/users/videogular/following{/other_user}","gists_url":"https://api.github.com/users/videogular/gists{/gist_id}","starred_url":"https://api.github.com/users/videogular/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/videogular/subscriptions","organizations_url":"https://api.github.com/users/videogular/orgs","repos_url":"https://api.github.com/users/videogular/repos","events_url":"https://api.github.com/users/videogular/events{/privacy}","received_events_url":"https://api.github.com/users/videogular/received_events","type":"Organization","site_admin":false},"repo":{"id":11823977,"name":"videogular","full_name":"videogular/videogular","owner":{"login":"videogular","id":15369882,"avatar_url":"https://avatars2.githubusercontent.com/u/15369882?v=3","gravatar_id":"","url":"https://api.github.com/users/videogular","html_url":"https://github.com/videogular","followers_url":"https://api.github.com/users/videogular/followers","following_url":"https://api.github.com/users/videogular/following{/other_user}","gists_url":"https://api.github.com/users/videogular/gists{/gist_id}","starred_url":"https://api.github.com/users/videogular/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/videogular/subscriptions","organizations_url":"https://api.github.com/users/videogular/orgs","repos_url":"https://api.github.com/users/videogular/repos","events_url":"https://api.github.com/users/videogular/events{/privacy}","received_events_url":"https://api.github.com/users/videogular/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/videogular/videogular","description":"The HTML5 video player for AngularJS","fork":false,"url":"https://api.github.com/repos/videogular/videogular","forks_url":"https://api.github.com/repos/videogular/videogular/forks","keys_url":"https://api.github.com/repos/videogular/videogular/keys{/key_id}","collaborators_url":"https://api.github.com/repos/videogular/videogular/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/videogular/videogular/teams","hooks_url":"https://api.github.com/repos/videogular/videogular/hooks","issue_events_url":"https://api.github.com/repos/videogular/videogular/issues/events{/number}","events_url":"https://api.github.com/repos/videogular/videogular/events","assignees_url":"https://api.github.com/repos/videogular/videogular/assignees{/user}","branches_url":"https://api.github.com/repos/videogular/videogular/branches{/branch}","tags_url":"https://api.github.com/repos/videogular/videogular/tags","blobs_url":"https://api.github.com/repos/videogular/videogular/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/videogular/videogular/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/videogular/videogular/git/refs{/sha}","trees_url":"https://api.github.com/repos/videogular/videogular/git/trees{/sha}","statuses_url":"https://api.github.com/repos/videogular/videogular/statuses/{sha}","languages_url":"https://api.github.com/repos/videogular/videogular/languages","stargazers_url":"https://api.github.com/repos/videogular/videogular/stargazers","contributors_url":"https://api.github.com/repos/videogular/videogular/contributors","subscribers_url":"https://api.github.com/repos/videogular/videogular/subscribers","subscription_url":"https://api.github.com/repos/videogular/videogular/subscription","commits_url":"https://api.github.com/repos/videogular/videogular/commits{/sha}","git_commits_url":"https://api.github.com/repos/videogular/videogular/git/commits{/sha}","comments_url":"https://api.github.com/repos/videogular/videogular/comments{/number}","issue_comment_url":"https://api.github.com/repos/videogular/videogular/issues/comments{/number}","contents_url":"https://api.github.com/repos/videogular/videogular/contents/{+path}","compare_url":"https://api.github.com/repos/videogular/videogular/compare/{base}...{head}","merges_url":"https://api.github.com/repos/videogular/videogular/merges","archive_url":"https://api.github.com/repos/videogular/videogular/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/videogular/videogular/downloads","issues_url":"https://api.github.com/repos/videogular/videogular/issues{/number}","pulls_url":"https://api.github.com/repos/videogular/videogular/pulls{/number}","milestones_url":"https://api.github.com/repos/videogular/videogular/milestones{/number}","notifications_url":"https://api.github.com/repos/videogular/videogular/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/videogular/videogular/labels{/name}","releases_url":"https://api.github.com/repos/videogular/videogular/releases{/id}","deployments_url":"https://api.github.com/repos/videogular/videogular/deployments","created_at":"2013-08-01T18:05:20Z","updated_at":"2017-06-17T19:54:11Z","pushed_at":"2017-06-16T17:52:19Z","git_url":"git://github.com/videogular/videogular.git","ssh_url":"git@github.com:videogular/videogular.git","clone_url":"https://github.com/videogular/videogular.git","svn_url":"https://github.com/videogular/videogular","homepage":"http://videogular.github.io/videogular/","size":52733,"stargazers_count":1404,"watchers_count":1404,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":345,"mirror_url":null,"open_issues_count":48,"forks":345,"open_issues":48,"watchers":1404,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/videogular/videogular/pulls/463"},"html":{"href":"https://github.com/videogular/videogular/pull/463"},"issue":{"href":"https://api.github.com/repos/videogular/videogular/issues/463"},"comments":{"href":"https://api.github.com/repos/videogular/videogular/issues/463/comments"},"review_comments":{"href":"https://api.github.com/repos/videogular/videogular/pulls/463/comments"},"review_comment":{"href":"https://api.github.com/repos/videogular/videogular/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/videogular/videogular/pulls/463/commits"},"statuses":{"href":"https://api.github.com/repos/videogular/videogular/statuses/f80bb28156b3f2de35a287949794a9c9e5bee2b3"}}}}
{"actor":{"display_login":"Elecash"}}