{"action":"created","comment":{"url":"https://api.github.com/repos/brandly/angular-youtube-embed/pulls/comments/34949504","id":34949504,"diff_hunk":"@@ -184,13 +184,44 @@ angular.module('youtube-embed', ['ng'])\n                 player.id = playerId;\n                 return player;\n             }\n+            \n+            function isEmpty (obj) {\n+                if (obj == null) return true;\n+                if (Object.keys) return Object.keys(obj).length == 0;\n+                var keys = [];\n+                for (var key in obj) if (_.has(obj, key)) keys.push(key);\n+                return keys.length == 0;\n+            };\n \n             function loadPlayer () {\n-                if (scope.videoId || scope.playerVars.list) {\n+                // If present, use an existing player\n+                if(scope.player && !isEmpty(scope.player) && scope.player.getIframe() && scope.player.cueVideoById === 'function') {","path":"src/angular-youtube-embed.js","position":16,"original_position":16,"commit_id":"9cf481a652d1b0066387c09b099357756552e4de","original_commit_id":"9cf481a652d1b0066387c09b099357756552e4de","user":{"login":"brandly","id":820696,"avatar_url":"https://avatars.githubusercontent.com/u/820696?v=3","gravatar_id":"","url":"https://api.github.com/users/brandly","html_url":"https://github.com/brandly","followers_url":"https://api.github.com/users/brandly/followers","following_url":"https://api.github.com/users/brandly/following{/other_user}","gists_url":"https://api.github.com/users/brandly/gists{/gist_id}","starred_url":"https://api.github.com/users/brandly/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/brandly/subscriptions","organizations_url":"https://api.github.com/users/brandly/orgs","repos_url":"https://api.github.com/users/brandly/repos","events_url":"https://api.github.com/users/brandly/events{/privacy}","received_events_url":"https://api.github.com/users/brandly/received_events","type":"User","site_admin":false},"body":"what does this `getIframe()` check do?","created_at":"2015-07-18T17:07:19Z","updated_at":"2015-07-18T17:07:19Z","html_url":"https://github.com/brandly/angular-youtube-embed/pull/61#discussion_r34949504","pull_request_url":"https://api.github.com/repos/brandly/angular-youtube-embed/pulls/61","_links":{"self":{"href":"https://api.github.com/repos/brandly/angular-youtube-embed/pulls/comments/34949504"},"html":{"href":"https://github.com/brandly/angular-youtube-embed/pull/61#discussion_r34949504"},"pull_request":{"href":"https://api.github.com/repos/brandly/angular-youtube-embed/pulls/61"}}},"pull_request":{"url":"https://api.github.com/repos/brandly/angular-youtube-embed/pulls/61","id":40150122,"html_url":"https://github.com/brandly/angular-youtube-embed/pull/61","diff_url":"https://github.com/brandly/angular-youtube-embed/pull/61.diff","patch_url":"https://github.com/brandly/angular-youtube-embed/pull/61.patch","issue_url":"https://api.github.com/repos/brandly/angular-youtube-embed/issues/61","number":61,"state":"open","locked":false,"title":"Use an existing player if present when video changes.","user":{"login":"alexthewilde","id":67973,"avatar_url":"https://avatars.githubusercontent.com/u/67973?v=3","gravatar_id":"","url":"https://api.github.com/users/alexthewilde","html_url":"https://github.com/alexthewilde","followers_url":"https://api.github.com/users/alexthewilde/followers","following_url":"https://api.github.com/users/alexthewilde/following{/other_user}","gists_url":"https://api.github.com/users/alexthewilde/gists{/gist_id}","starred_url":"https://api.github.com/users/alexthewilde/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alexthewilde/subscriptions","organizations_url":"https://api.github.com/users/alexthewilde/orgs","repos_url":"https://api.github.com/users/alexthewilde/repos","events_url":"https://api.github.com/users/alexthewilde/events{/privacy}","received_events_url":"https://api.github.com/users/alexthewilde/received_events","type":"User","site_admin":false},"body":"See original issue https://github.com/brandly/angular-youtube-embed/issues/46\r\nFix adapted from https://github.com/brandly/angular-youtube-embed/pull/48","created_at":"2015-07-16T16:44:29Z","updated_at":"2015-07-18T17:07:19Z","closed_at":null,"merged_at":null,"merge_commit_sha":"bed7d595e4199039aa66710498e645d6cfe228ae","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/brandly/angular-youtube-embed/pulls/61/commits","review_comments_url":"https://api.github.com/repos/brandly/angular-youtube-embed/pulls/61/comments","review_comment_url":"https://api.github.com/repos/brandly/angular-youtube-embed/pulls/comments{/number}","comments_url":"https://api.github.com/repos/brandly/angular-youtube-embed/issues/61/comments","statuses_url":"https://api.github.com/repos/brandly/angular-youtube-embed/statuses/9cf481a652d1b0066387c09b099357756552e4de","head":{"label":"alexthewilde:master","ref":"master","sha":"9cf481a652d1b0066387c09b099357756552e4de","user":{"login":"alexthewilde","id":67973,"avatar_url":"https://avatars.githubusercontent.com/u/67973?v=3","gravatar_id":"","url":"https://api.github.com/users/alexthewilde","html_url":"https://github.com/alexthewilde","followers_url":"https://api.github.com/users/alexthewilde/followers","following_url":"https://api.github.com/users/alexthewilde/following{/other_user}","gists_url":"https://api.github.com/users/alexthewilde/gists{/gist_id}","starred_url":"https://api.github.com/users/alexthewilde/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alexthewilde/subscriptions","organizations_url":"https://api.github.com/users/alexthewilde/orgs","repos_url":"https://api.github.com/users/alexthewilde/repos","events_url":"https://api.github.com/users/alexthewilde/events{/privacy}","received_events_url":"https://api.github.com/users/alexthewilde/received_events","type":"User","site_admin":false},"repo":{"id":39206826,"name":"angular-youtube-embed","full_name":"alexthewilde/angular-youtube-embed","owner":{"login":"alexthewilde","id":67973,"avatar_url":"https://avatars.githubusercontent.com/u/67973?v=3","gravatar_id":"","url":"https://api.github.com/users/alexthewilde","html_url":"https://github.com/alexthewilde","followers_url":"https://api.github.com/users/alexthewilde/followers","following_url":"https://api.github.com/users/alexthewilde/following{/other_user}","gists_url":"https://api.github.com/users/alexthewilde/gists{/gist_id}","starred_url":"https://api.github.com/users/alexthewilde/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alexthewilde/subscriptions","organizations_url":"https://api.github.com/users/alexthewilde/orgs","repos_url":"https://api.github.com/users/alexthewilde/repos","events_url":"https://api.github.com/users/alexthewilde/events{/privacy}","received_events_url":"https://api.github.com/users/alexthewilde/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/alexthewilde/angular-youtube-embed","description":":tv: Embed a YouTube player with a simple directive","fork":true,"url":"https://api.github.com/repos/alexthewilde/angular-youtube-embed","forks_url":"https://api.github.com/repos/alexthewilde/angular-youtube-embed/forks","keys_url":"https://api.github.com/repos/alexthewilde/angular-youtube-embed/keys{/key_id}","collaborators_url":"https://api.github.com/repos/alexthewilde/angular-youtube-embed/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/alexthewilde/angular-youtube-embed/teams","hooks_url":"https://api.github.com/repos/alexthewilde/angular-youtube-embed/hooks","issue_events_url":"https://api.github.com/repos/alexthewilde/angular-youtube-embed/issues/events{/number}","events_url":"https://api.github.com/repos/alexthewilde/angular-youtube-embed/events","assignees_url":"https://api.github.com/repos/alexthewilde/angular-youtube-embed/assignees{/user}","branches_url":"https://api.github.com/repos/alexthewilde/angular-youtube-embed/branches{/branch}","tags_url":"https://api.github.com/repos/alexthewilde/angular-youtube-embed/tags","blobs_url":"https://api.github.com/repos/alexthewilde/angular-youtube-embed/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/alexthewilde/angular-youtube-embed/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/alexthewilde/angular-youtube-embed/git/refs{/sha}","trees_url":"https://api.github.com/repos/alexthewilde/angular-youtube-embed/git/trees{/sha}","statuses_url":"https://api.github.com/repos/alexthewilde/angular-youtube-embed/statuses/{sha}","languages_url":"https://api.github.com/repos/alexthewilde/angular-youtube-embed/languages","stargazers_url":"https://api.github.com/repos/alexthewilde/angular-youtube-embed/stargazers","contributors_url":"https://api.github.com/repos/alexthewilde/angular-youtube-embed/contributors","subscribers_url":"https://api.github.com/repos/alexthewilde/angular-youtube-embed/subscribers","subscription_url":"https://api.github.com/repos/alexthewilde/angular-youtube-embed/subscription","commits_url":"https://api.github.com/repos/alexthewilde/angular-youtube-embed/commits{/sha}","git_commits_url":"https://api.github.com/repos/alexthewilde/angular-youtube-embed/git/commits{/sha}","comments_url":"https://api.github.com/repos/alexthewilde/angular-youtube-embed/comments{/number}","issue_comment_url":"https://api.github.com/repos/alexthewilde/angular-youtube-embed/issues/comments{/number}","contents_url":"https://api.github.com/repos/alexthewilde/angular-youtube-embed/contents/{+path}","compare_url":"https://api.github.com/repos/alexthewilde/angular-youtube-embed/compare/{base}...{head}","merges_url":"https://api.github.com/repos/alexthewilde/angular-youtube-embed/merges","archive_url":"https://api.github.com/repos/alexthewilde/angular-youtube-embed/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/alexthewilde/angular-youtube-embed/downloads","issues_url":"https://api.github.com/repos/alexthewilde/angular-youtube-embed/issues{/number}","pulls_url":"https://api.github.com/repos/alexthewilde/angular-youtube-embed/pulls{/number}","milestones_url":"https://api.github.com/repos/alexthewilde/angular-youtube-embed/milestones{/number}","notifications_url":"https://api.github.com/repos/alexthewilde/angular-youtube-embed/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/alexthewilde/angular-youtube-embed/labels{/name}","releases_url":"https://api.github.com/repos/alexthewilde/angular-youtube-embed/releases{/id}","created_at":"2015-07-16T16:00:29Z","updated_at":"2015-07-16T16:00:30Z","pushed_at":"2015-07-16T18:49:33Z","git_url":"git://github.com/alexthewilde/angular-youtube-embed.git","ssh_url":"git@github.com:alexthewilde/angular-youtube-embed.git","clone_url":"https://github.com/alexthewilde/angular-youtube-embed.git","svn_url":"https://github.com/alexthewilde/angular-youtube-embed","homepage":"http://brandly.github.io/angular-youtube-embed/","size":882,"stargazers_count":0,"watchers_count":0,"language":"HTML","has_issues":false,"has_downloads":true,"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":"brandly:master","ref":"master","sha":"b0076989a4809bf9fe951368cc4d00bd8ac0c64e","user":{"login":"brandly","id":820696,"avatar_url":"https://avatars.githubusercontent.com/u/820696?v=3","gravatar_id":"","url":"https://api.github.com/users/brandly","html_url":"https://github.com/brandly","followers_url":"https://api.github.com/users/brandly/followers","following_url":"https://api.github.com/users/brandly/following{/other_user}","gists_url":"https://api.github.com/users/brandly/gists{/gist_id}","starred_url":"https://api.github.com/users/brandly/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/brandly/subscriptions","organizations_url":"https://api.github.com/users/brandly/orgs","repos_url":"https://api.github.com/users/brandly/repos","events_url":"https://api.github.com/users/brandly/events{/privacy}","received_events_url":"https://api.github.com/users/brandly/received_events","type":"User","site_admin":false},"repo":{"id":18026035,"name":"angular-youtube-embed","full_name":"brandly/angular-youtube-embed","owner":{"login":"brandly","id":820696,"avatar_url":"https://avatars.githubusercontent.com/u/820696?v=3","gravatar_id":"","url":"https://api.github.com/users/brandly","html_url":"https://github.com/brandly","followers_url":"https://api.github.com/users/brandly/followers","following_url":"https://api.github.com/users/brandly/following{/other_user}","gists_url":"https://api.github.com/users/brandly/gists{/gist_id}","starred_url":"https://api.github.com/users/brandly/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/brandly/subscriptions","organizations_url":"https://api.github.com/users/brandly/orgs","repos_url":"https://api.github.com/users/brandly/repos","events_url":"https://api.github.com/users/brandly/events{/privacy}","received_events_url":"https://api.github.com/users/brandly/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/brandly/angular-youtube-embed","description":":tv: Embed a YouTube player with a simple directive","fork":false,"url":"https://api.github.com/repos/brandly/angular-youtube-embed","forks_url":"https://api.github.com/repos/brandly/angular-youtube-embed/forks","keys_url":"https://api.github.com/repos/brandly/angular-youtube-embed/keys{/key_id}","collaborators_url":"https://api.github.com/repos/brandly/angular-youtube-embed/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/brandly/angular-youtube-embed/teams","hooks_url":"https://api.github.com/repos/brandly/angular-youtube-embed/hooks","issue_events_url":"https://api.github.com/repos/brandly/angular-youtube-embed/issues/events{/number}","events_url":"https://api.github.com/repos/brandly/angular-youtube-embed/events","assignees_url":"https://api.github.com/repos/brandly/angular-youtube-embed/assignees{/user}","branches_url":"https://api.github.com/repos/brandly/angular-youtube-embed/branches{/branch}","tags_url":"https://api.github.com/repos/brandly/angular-youtube-embed/tags","blobs_url":"https://api.github.com/repos/brandly/angular-youtube-embed/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/brandly/angular-youtube-embed/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/brandly/angular-youtube-embed/git/refs{/sha}","trees_url":"https://api.github.com/repos/brandly/angular-youtube-embed/git/trees{/sha}","statuses_url":"https://api.github.com/repos/brandly/angular-youtube-embed/statuses/{sha}","languages_url":"https://api.github.com/repos/brandly/angular-youtube-embed/languages","stargazers_url":"https://api.github.com/repos/brandly/angular-youtube-embed/stargazers","contributors_url":"https://api.github.com/repos/brandly/angular-youtube-embed/contributors","subscribers_url":"https://api.github.com/repos/brandly/angular-youtube-embed/subscribers","subscription_url":"https://api.github.com/repos/brandly/angular-youtube-embed/subscription","commits_url":"https://api.github.com/repos/brandly/angular-youtube-embed/commits{/sha}","git_commits_url":"https://api.github.com/repos/brandly/angular-youtube-embed/git/commits{/sha}","comments_url":"https://api.github.com/repos/brandly/angular-youtube-embed/comments{/number}","issue_comment_url":"https://api.github.com/repos/brandly/angular-youtube-embed/issues/comments{/number}","contents_url":"https://api.github.com/repos/brandly/angular-youtube-embed/contents/{+path}","compare_url":"https://api.github.com/repos/brandly/angular-youtube-embed/compare/{base}...{head}","merges_url":"https://api.github.com/repos/brandly/angular-youtube-embed/merges","archive_url":"https://api.github.com/repos/brandly/angular-youtube-embed/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/brandly/angular-youtube-embed/downloads","issues_url":"https://api.github.com/repos/brandly/angular-youtube-embed/issues{/number}","pulls_url":"https://api.github.com/repos/brandly/angular-youtube-embed/pulls{/number}","milestones_url":"https://api.github.com/repos/brandly/angular-youtube-embed/milestones{/number}","notifications_url":"https://api.github.com/repos/brandly/angular-youtube-embed/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/brandly/angular-youtube-embed/labels{/name}","releases_url":"https://api.github.com/repos/brandly/angular-youtube-embed/releases{/id}","created_at":"2014-03-23T03:56:24Z","updated_at":"2015-07-17T08:36:24Z","pushed_at":"2015-07-16T18:49:34Z","git_url":"git://github.com/brandly/angular-youtube-embed.git","ssh_url":"git@github.com:brandly/angular-youtube-embed.git","clone_url":"https://github.com/brandly/angular-youtube-embed.git","svn_url":"https://github.com/brandly/angular-youtube-embed","homepage":"http://brandly.github.io/angular-youtube-embed/","size":882,"stargazers_count":219,"watchers_count":219,"language":"HTML","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":55,"mirror_url":null,"open_issues_count":9,"forks":55,"open_issues":9,"watchers":219,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/brandly/angular-youtube-embed/pulls/61"},"html":{"href":"https://github.com/brandly/angular-youtube-embed/pull/61"},"issue":{"href":"https://api.github.com/repos/brandly/angular-youtube-embed/issues/61"},"comments":{"href":"https://api.github.com/repos/brandly/angular-youtube-embed/issues/61/comments"},"review_comments":{"href":"https://api.github.com/repos/brandly/angular-youtube-embed/pulls/61/comments"},"review_comment":{"href":"https://api.github.com/repos/brandly/angular-youtube-embed/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/brandly/angular-youtube-embed/pulls/61/commits"},"statuses":{"href":"https://api.github.com/repos/brandly/angular-youtube-embed/statuses/9cf481a652d1b0066387c09b099357756552e4de"}}}}