{"action":"created","comment":{"url":"https://api.github.com/repos/ampproject/amphtml/pulls/comments/46497155","id":46497155,"diff_hunk":"@@ -0,0 +1,78 @@\n+/**\n+ * Copyright 2015 Brightcove. All Rights Reserved.\n+ *\n+ * Licensed under the Apache License, Version 2.0 (the \"License\");\n+ * you may not use this file except in compliance with the License.\n+ * You may obtain a copy of the License at\n+ *\n+ *      http://www.apache.org/licenses/LICENSE-2.0\n+ *\n+ * Unless required by applicable law or agreed to in writing, software\n+ * distributed under the License is distributed on an \"AS-IS\" BASIS,\n+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n+ * See the License for the specific language governing permissions and\n+ * limitations under the License.\n+ */\n+\n+import {isLayoutSizeDefined} from '../../../src/layout';\n+import {loadPromise} from '../../../src/event-helper';\n+\n+\n+class AmpBrightcove extends AMP.BaseElement {\n+\n+  /** @override */\n+  createdCallback() {\n+    this.preconnect.url('https://players.brightcove.net');\n+  }\n+\n+  /** @override */\n+  isLayoutSupported(layout) {\n+    return isLayoutSizeDefined(layout);\n+  }\n+\n+  /** @override */\n+  layoutCallback() {\n+    var width = this.element.getAttribute('width');\n+    var height = this.element.getAttribute('height');\n+    var account = AMP.assert(\n+        this.element.getAttribute('data-account'),\n+        'The data-account attribute is required for <amp-brightcove> %s',\n+        this.element);\n+    var playerid = (this.element.getAttribute('data-player-id') || 'default');\n+    var embed = (this.element.getAttribute('data-embed') || 'default');\n+    var iframe = document.createElement('iframe');\n+    var src = 'https://players.brightcove.net/' + account + '/' + playerid + '_' + embed + '/index.html';\n+    if (this.element.getAttribute('data-playlist-id')) {\n+      src += '?playlistId=' +  this.element.getAttribute('data-playlist-id');\n+    } else if (this.element.getAttribute('data-video-id')) {\n+      src += '?videoId=' +  this.element.getAttribute('data-video-id');\n+    }\n+    iframe.setAttribute('frameborder', '0');\n+    iframe.setAttribute('allowfullscreen', 'true');\n+    iframe.src = src;\n+    this.applyFillContent(iframe);\n+    iframe.width = width;\n+    iframe.height = height;\n+    this.element.appendChild(iframe);\n+    /** @private {?Element} */\n+    this.iframe_ = iframe;\n+    return loadPromise(iframe);","path":"extensions/amp-brightcove/0.1/amp-brightcove.js","position":59,"original_position":59,"commit_id":"719e99abc53926ed6c5ce002916314ae32186c65","original_commit_id":"719e99abc53926ed6c5ce002916314ae32186c65","user":{"login":"dvoytenko","id":726049,"avatar_url":"https://avatars.githubusercontent.com/u/726049?v=3","gravatar_id":"","url":"https://api.github.com/users/dvoytenko","html_url":"https://github.com/dvoytenko","followers_url":"https://api.github.com/users/dvoytenko/followers","following_url":"https://api.github.com/users/dvoytenko/following{/other_user}","gists_url":"https://api.github.com/users/dvoytenko/gists{/gist_id}","starred_url":"https://api.github.com/users/dvoytenko/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dvoytenko/subscriptions","organizations_url":"https://api.github.com/users/dvoytenko/orgs","repos_url":"https://api.github.com/users/dvoytenko/repos","events_url":"https://api.github.com/users/dvoytenko/events{/privacy}","received_events_url":"https://api.github.com/users/dvoytenko/received_events","type":"User","site_admin":false},"body":"Please also whitelist your element in the https://github.com/ampproject/amphtml/blob/master/src/layout.js#L73 - it's a minor thing, but a good touch.","created_at":"2015-12-03T00:15:31Z","updated_at":"2015-12-03T00:15:31Z","html_url":"https://github.com/ampproject/amphtml/pull/1052#discussion_r46497155","pull_request_url":"https://api.github.com/repos/ampproject/amphtml/pulls/1052","_links":{"self":{"href":"https://api.github.com/repos/ampproject/amphtml/pulls/comments/46497155"},"html":{"href":"https://github.com/ampproject/amphtml/pull/1052#discussion_r46497155"},"pull_request":{"href":"https://api.github.com/repos/ampproject/amphtml/pulls/1052"}}},"pull_request":{"url":"https://api.github.com/repos/ampproject/amphtml/pulls/1052","id":52472194,"html_url":"https://github.com/ampproject/amphtml/pull/1052","diff_url":"https://github.com/ampproject/amphtml/pull/1052.diff","patch_url":"https://github.com/ampproject/amphtml/pull/1052.patch","issue_url":"https://api.github.com/repos/ampproject/amphtml/issues/1052","number":1052,"state":"open","locked":false,"title":"Brightcove player component","user":{"login":"mister-ben","id":1676039,"avatar_url":"https://avatars.githubusercontent.com/u/1676039?v=3","gravatar_id":"","url":"https://api.github.com/users/mister-ben","html_url":"https://github.com/mister-ben","followers_url":"https://api.github.com/users/mister-ben/followers","following_url":"https://api.github.com/users/mister-ben/following{/other_user}","gists_url":"https://api.github.com/users/mister-ben/gists{/gist_id}","starred_url":"https://api.github.com/users/mister-ben/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mister-ben/subscriptions","organizations_url":"https://api.github.com/users/mister-ben/orgs","repos_url":"https://api.github.com/users/mister-ben/repos","events_url":"https://api.github.com/users/mister-ben/events{/privacy}","received_events_url":"https://api.github.com/users/mister-ben/received_events","type":"User","site_admin":false},"body":"This is an `amp-brightcove` component to implement a Brightcove player as outlined in #1048.\r\n\r\nCloses #1048.","created_at":"2015-12-02T23:46:06Z","updated_at":"2015-12-03T00:15:31Z","closed_at":null,"merged_at":null,"merge_commit_sha":"fdc6cc80dca60611b7690a3b8596cfa6eb526452","assignee":{"login":"dvoytenko","id":726049,"avatar_url":"https://avatars.githubusercontent.com/u/726049?v=3","gravatar_id":"","url":"https://api.github.com/users/dvoytenko","html_url":"https://github.com/dvoytenko","followers_url":"https://api.github.com/users/dvoytenko/followers","following_url":"https://api.github.com/users/dvoytenko/following{/other_user}","gists_url":"https://api.github.com/users/dvoytenko/gists{/gist_id}","starred_url":"https://api.github.com/users/dvoytenko/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dvoytenko/subscriptions","organizations_url":"https://api.github.com/users/dvoytenko/orgs","repos_url":"https://api.github.com/users/dvoytenko/repos","events_url":"https://api.github.com/users/dvoytenko/events{/privacy}","received_events_url":"https://api.github.com/users/dvoytenko/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/ampproject/amphtml/pulls/1052/commits","review_comments_url":"https://api.github.com/repos/ampproject/amphtml/pulls/1052/comments","review_comment_url":"https://api.github.com/repos/ampproject/amphtml/pulls/comments{/number}","comments_url":"https://api.github.com/repos/ampproject/amphtml/issues/1052/comments","statuses_url":"https://api.github.com/repos/ampproject/amphtml/statuses/719e99abc53926ed6c5ce002916314ae32186c65","head":{"label":"BrightcoveOS:brightcove","ref":"brightcove","sha":"719e99abc53926ed6c5ce002916314ae32186c65","user":{"login":"BrightcoveOS","id":442411,"avatar_url":"https://avatars.githubusercontent.com/u/442411?v=3","gravatar_id":"","url":"https://api.github.com/users/BrightcoveOS","html_url":"https://github.com/BrightcoveOS","followers_url":"https://api.github.com/users/BrightcoveOS/followers","following_url":"https://api.github.com/users/BrightcoveOS/following{/other_user}","gists_url":"https://api.github.com/users/BrightcoveOS/gists{/gist_id}","starred_url":"https://api.github.com/users/BrightcoveOS/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/BrightcoveOS/subscriptions","organizations_url":"https://api.github.com/users/BrightcoveOS/orgs","repos_url":"https://api.github.com/users/BrightcoveOS/repos","events_url":"https://api.github.com/users/BrightcoveOS/events{/privacy}","received_events_url":"https://api.github.com/users/BrightcoveOS/received_events","type":"Organization","site_admin":false},"repo":{"id":44672099,"name":"amphtml","full_name":"BrightcoveOS/amphtml","owner":{"login":"BrightcoveOS","id":442411,"avatar_url":"https://avatars.githubusercontent.com/u/442411?v=3","gravatar_id":"","url":"https://api.github.com/users/BrightcoveOS","html_url":"https://github.com/BrightcoveOS","followers_url":"https://api.github.com/users/BrightcoveOS/followers","following_url":"https://api.github.com/users/BrightcoveOS/following{/other_user}","gists_url":"https://api.github.com/users/BrightcoveOS/gists{/gist_id}","starred_url":"https://api.github.com/users/BrightcoveOS/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/BrightcoveOS/subscriptions","organizations_url":"https://api.github.com/users/BrightcoveOS/orgs","repos_url":"https://api.github.com/users/BrightcoveOS/repos","events_url":"https://api.github.com/users/BrightcoveOS/events{/privacy}","received_events_url":"https://api.github.com/users/BrightcoveOS/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/BrightcoveOS/amphtml","description":"AMP HTML source code, samples, and documentation.  See below for more info.","fork":true,"url":"https://api.github.com/repos/BrightcoveOS/amphtml","forks_url":"https://api.github.com/repos/BrightcoveOS/amphtml/forks","keys_url":"https://api.github.com/repos/BrightcoveOS/amphtml/keys{/key_id}","collaborators_url":"https://api.github.com/repos/BrightcoveOS/amphtml/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/BrightcoveOS/amphtml/teams","hooks_url":"https://api.github.com/repos/BrightcoveOS/amphtml/hooks","issue_events_url":"https://api.github.com/repos/BrightcoveOS/amphtml/issues/events{/number}","events_url":"https://api.github.com/repos/BrightcoveOS/amphtml/events","assignees_url":"https://api.github.com/repos/BrightcoveOS/amphtml/assignees{/user}","branches_url":"https://api.github.com/repos/BrightcoveOS/amphtml/branches{/branch}","tags_url":"https://api.github.com/repos/BrightcoveOS/amphtml/tags","blobs_url":"https://api.github.com/repos/BrightcoveOS/amphtml/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/BrightcoveOS/amphtml/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/BrightcoveOS/amphtml/git/refs{/sha}","trees_url":"https://api.github.com/repos/BrightcoveOS/amphtml/git/trees{/sha}","statuses_url":"https://api.github.com/repos/BrightcoveOS/amphtml/statuses/{sha}","languages_url":"https://api.github.com/repos/BrightcoveOS/amphtml/languages","stargazers_url":"https://api.github.com/repos/BrightcoveOS/amphtml/stargazers","contributors_url":"https://api.github.com/repos/BrightcoveOS/amphtml/contributors","subscribers_url":"https://api.github.com/repos/BrightcoveOS/amphtml/subscribers","subscription_url":"https://api.github.com/repos/BrightcoveOS/amphtml/subscription","commits_url":"https://api.github.com/repos/BrightcoveOS/amphtml/commits{/sha}","git_commits_url":"https://api.github.com/repos/BrightcoveOS/amphtml/git/commits{/sha}","comments_url":"https://api.github.com/repos/BrightcoveOS/amphtml/comments{/number}","issue_comment_url":"https://api.github.com/repos/BrightcoveOS/amphtml/issues/comments{/number}","contents_url":"https://api.github.com/repos/BrightcoveOS/amphtml/contents/{+path}","compare_url":"https://api.github.com/repos/BrightcoveOS/amphtml/compare/{base}...{head}","merges_url":"https://api.github.com/repos/BrightcoveOS/amphtml/merges","archive_url":"https://api.github.com/repos/BrightcoveOS/amphtml/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/BrightcoveOS/amphtml/downloads","issues_url":"https://api.github.com/repos/BrightcoveOS/amphtml/issues{/number}","pulls_url":"https://api.github.com/repos/BrightcoveOS/amphtml/pulls{/number}","milestones_url":"https://api.github.com/repos/BrightcoveOS/amphtml/milestones{/number}","notifications_url":"https://api.github.com/repos/BrightcoveOS/amphtml/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/BrightcoveOS/amphtml/labels{/name}","releases_url":"https://api.github.com/repos/BrightcoveOS/amphtml/releases{/id}","created_at":"2015-10-21T11:37:30Z","updated_at":"2015-11-19T18:13:30Z","pushed_at":"2015-12-02T19:52:08Z","git_url":"git://github.com/BrightcoveOS/amphtml.git","ssh_url":"git@github.com:BrightcoveOS/amphtml.git","clone_url":"https://github.com/BrightcoveOS/amphtml.git","svn_url":"https://github.com/BrightcoveOS/amphtml","homepage":"https://ampproject.org","size":13683,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_downloads":false,"has_wiki":false,"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":"ampproject:master","ref":"master","sha":"610dcee80f9f2494e05c36e2141cdcfe45954cc5","user":{"login":"ampproject","id":14114390,"avatar_url":"https://avatars.githubusercontent.com/u/14114390?v=3","gravatar_id":"","url":"https://api.github.com/users/ampproject","html_url":"https://github.com/ampproject","followers_url":"https://api.github.com/users/ampproject/followers","following_url":"https://api.github.com/users/ampproject/following{/other_user}","gists_url":"https://api.github.com/users/ampproject/gists{/gist_id}","starred_url":"https://api.github.com/users/ampproject/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ampproject/subscriptions","organizations_url":"https://api.github.com/users/ampproject/orgs","repos_url":"https://api.github.com/users/ampproject/repos","events_url":"https://api.github.com/users/ampproject/events{/privacy}","received_events_url":"https://api.github.com/users/ampproject/received_events","type":"Organization","site_admin":false},"repo":{"id":41766002,"name":"amphtml","full_name":"ampproject/amphtml","owner":{"login":"ampproject","id":14114390,"avatar_url":"https://avatars.githubusercontent.com/u/14114390?v=3","gravatar_id":"","url":"https://api.github.com/users/ampproject","html_url":"https://github.com/ampproject","followers_url":"https://api.github.com/users/ampproject/followers","following_url":"https://api.github.com/users/ampproject/following{/other_user}","gists_url":"https://api.github.com/users/ampproject/gists{/gist_id}","starred_url":"https://api.github.com/users/ampproject/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ampproject/subscriptions","organizations_url":"https://api.github.com/users/ampproject/orgs","repos_url":"https://api.github.com/users/ampproject/repos","events_url":"https://api.github.com/users/ampproject/events{/privacy}","received_events_url":"https://api.github.com/users/ampproject/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/ampproject/amphtml","description":"AMP HTML source code, samples, and documentation.  See below for more info.","fork":false,"url":"https://api.github.com/repos/ampproject/amphtml","forks_url":"https://api.github.com/repos/ampproject/amphtml/forks","keys_url":"https://api.github.com/repos/ampproject/amphtml/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ampproject/amphtml/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ampproject/amphtml/teams","hooks_url":"https://api.github.com/repos/ampproject/amphtml/hooks","issue_events_url":"https://api.github.com/repos/ampproject/amphtml/issues/events{/number}","events_url":"https://api.github.com/repos/ampproject/amphtml/events","assignees_url":"https://api.github.com/repos/ampproject/amphtml/assignees{/user}","branches_url":"https://api.github.com/repos/ampproject/amphtml/branches{/branch}","tags_url":"https://api.github.com/repos/ampproject/amphtml/tags","blobs_url":"https://api.github.com/repos/ampproject/amphtml/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ampproject/amphtml/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ampproject/amphtml/git/refs{/sha}","trees_url":"https://api.github.com/repos/ampproject/amphtml/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ampproject/amphtml/statuses/{sha}","languages_url":"https://api.github.com/repos/ampproject/amphtml/languages","stargazers_url":"https://api.github.com/repos/ampproject/amphtml/stargazers","contributors_url":"https://api.github.com/repos/ampproject/amphtml/contributors","subscribers_url":"https://api.github.com/repos/ampproject/amphtml/subscribers","subscription_url":"https://api.github.com/repos/ampproject/amphtml/subscription","commits_url":"https://api.github.com/repos/ampproject/amphtml/commits{/sha}","git_commits_url":"https://api.github.com/repos/ampproject/amphtml/git/commits{/sha}","comments_url":"https://api.github.com/repos/ampproject/amphtml/comments{/number}","issue_comment_url":"https://api.github.com/repos/ampproject/amphtml/issues/comments{/number}","contents_url":"https://api.github.com/repos/ampproject/amphtml/contents/{+path}","compare_url":"https://api.github.com/repos/ampproject/amphtml/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ampproject/amphtml/merges","archive_url":"https://api.github.com/repos/ampproject/amphtml/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ampproject/amphtml/downloads","issues_url":"https://api.github.com/repos/ampproject/amphtml/issues{/number}","pulls_url":"https://api.github.com/repos/ampproject/amphtml/pulls{/number}","milestones_url":"https://api.github.com/repos/ampproject/amphtml/milestones{/number}","notifications_url":"https://api.github.com/repos/ampproject/amphtml/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ampproject/amphtml/labels{/name}","releases_url":"https://api.github.com/repos/ampproject/amphtml/releases{/id}","created_at":"2015-09-01T22:10:53Z","updated_at":"2015-12-02T22:57:05Z","pushed_at":"2015-12-02T23:46:06Z","git_url":"git://github.com/ampproject/amphtml.git","ssh_url":"git@github.com:ampproject/amphtml.git","clone_url":"https://github.com/ampproject/amphtml.git","svn_url":"https://github.com/ampproject/amphtml","homepage":"https://ampproject.org","size":14893,"stargazers_count":4821,"watchers_count":4821,"language":"JavaScript","has_issues":true,"has_downloads":false,"has_wiki":false,"has_pages":false,"forks_count":454,"mirror_url":null,"open_issues_count":148,"forks":454,"open_issues":148,"watchers":4821,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/ampproject/amphtml/pulls/1052"},"html":{"href":"https://github.com/ampproject/amphtml/pull/1052"},"issue":{"href":"https://api.github.com/repos/ampproject/amphtml/issues/1052"},"comments":{"href":"https://api.github.com/repos/ampproject/amphtml/issues/1052/comments"},"review_comments":{"href":"https://api.github.com/repos/ampproject/amphtml/pulls/1052/comments"},"review_comment":{"href":"https://api.github.com/repos/ampproject/amphtml/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/ampproject/amphtml/pulls/1052/commits"},"statuses":{"href":"https://api.github.com/repos/ampproject/amphtml/statuses/719e99abc53926ed6c5ce002916314ae32186c65"}}}}