{"action":"created","comment":{"url":"https://api.github.com/repos/ampproject/amphtml/pulls/comments/66987637","id":66987637,"diff_hunk":"@@ -0,0 +1,95 @@\n+/**\n+ * Copyright 2016 The AMP HTML Authors. 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+import {user} from '../../../src/log';\n+\n+class AmpO2player extends AMP.BaseElement {\n+\n+    /** @override */\n+    preconnectCallback() {\n+      this.preconnect.url(this.domain_);\n+    }\n+\n+    /** @override */\n+    isLayoutSupported(layout) {\n+      return isLayoutSizeDefined(layout);\n+    }\n+\n+    /** @override */\n+    layoutCallback() {\n+      const width = this.element.getAttribute('width');\n+      const height = this.element.getAttribute('height');\n+      const pid = this.element.getAttribute('data-pid');\n+      const bcid = this.element.getAttribute('data-bcid');\n+      const bid = this.element.getAttribute('data-bid');\n+      const vid = this.element.getAttribute('data-vid');\n+      const macros = this.element.getAttribute('data-macros');\n+      const env = this.element.getAttribute('data-env');\n+      user.assert(\n+            (pid && bcid) || vid,\n+            'Either data-pid and data-bcid or data-vid attribute is required ' +\n+            'for <amp-o2player> %s',\n+            this.element);\n+      /** @private {string} */\n+      this.domain_ = '//delivery.' +\n+          (env != 'stage' ? '' : 'dev.') + 'vidible.tv';\n+      let src = `${this.domain_}/htmlembed/`;\n+      const queryParams = [];\n+      if (pid && bcid) {\n+        src += 'pid=' + encodeURIComponent(pid) + '/'\n+            + encodeURIComponent(bcid) + '.html';\n+        if (bid) {\n+          queryParams.push('bid=' + encodeURIComponent(bid));\n+        }\n+        if (vid) {\n+          queryParams.push('vid=' + encodeURIComponent(vid));\n+        }\n+      } else if (vid) {\n+        src += encodeURIComponent(vid) + '.html';\n+      }\n+      if (macros) {\n+        queryParams.push(macros);\n+      }\n+      if (queryParams.length > 0) {\n+        src += '?' + queryParams.join('&');\n+      }\n+      const iframe = this.element.ownerDocument.createElement('iframe');","path":"extensions/amp-o2player/0.1/amp-o2player.js","position":null,"original_position":71,"commit_id":"0ddbd2aa7b9f89605b5b4cb2b8b1e4937eeaebbb","original_commit_id":"50af5ee7e1b7ba5e0656ff4308bda178d5a9ec89","user":{"login":"cramforce","id":89679,"avatar_url":"https://avatars.githubusercontent.com/u/89679?v=3","gravatar_id":"","url":"https://api.github.com/users/cramforce","html_url":"https://github.com/cramforce","followers_url":"https://api.github.com/users/cramforce/followers","following_url":"https://api.github.com/users/cramforce/following{/other_user}","gists_url":"https://api.github.com/users/cramforce/gists{/gist_id}","starred_url":"https://api.github.com/users/cramforce/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cramforce/subscriptions","organizations_url":"https://api.github.com/users/cramforce/orgs","repos_url":"https://api.github.com/users/cramforce/repos","events_url":"https://api.github.com/users/cramforce/events{/privacy}","received_events_url":"https://api.github.com/users/cramforce/received_events","type":"User","site_admin":false},"body":"Just following up here: AMP works much better if a poster image is shown while the iframe is loading. Do you have a way to construct the image URL? If not, could you add such a way on the server side?","created_at":"2016-06-14T14:58:56Z","updated_at":"2016-06-14T14:58:56Z","html_url":"https://github.com/ampproject/amphtml/pull/3305#discussion_r66987637","pull_request_url":"https://api.github.com/repos/ampproject/amphtml/pulls/3305","_links":{"self":{"href":"https://api.github.com/repos/ampproject/amphtml/pulls/comments/66987637"},"html":{"href":"https://github.com/ampproject/amphtml/pull/3305#discussion_r66987637"},"pull_request":{"href":"https://api.github.com/repos/ampproject/amphtml/pulls/3305"}}},"pull_request":{"url":"https://api.github.com/repos/ampproject/amphtml/pulls/3305","id":71217551,"html_url":"https://github.com/ampproject/amphtml/pull/3305","diff_url":"https://github.com/ampproject/amphtml/pull/3305.diff","patch_url":"https://github.com/ampproject/amphtml/pull/3305.patch","issue_url":"https://api.github.com/repos/ampproject/amphtml/issues/3305","number":3305,"state":"open","locked":false,"title":"Add o2player extension","user":{"login":"yevheniiminin","id":15870873,"avatar_url":"https://avatars.githubusercontent.com/u/15870873?v=3","gravatar_id":"","url":"https://api.github.com/users/yevheniiminin","html_url":"https://github.com/yevheniiminin","followers_url":"https://api.github.com/users/yevheniiminin/followers","following_url":"https://api.github.com/users/yevheniiminin/following{/other_user}","gists_url":"https://api.github.com/users/yevheniiminin/gists{/gist_id}","starred_url":"https://api.github.com/users/yevheniiminin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yevheniiminin/subscriptions","organizations_url":"https://api.github.com/users/yevheniiminin/orgs","repos_url":"https://api.github.com/users/yevheniiminin/repos","events_url":"https://api.github.com/users/yevheniiminin/events{/privacy}","received_events_url":"https://api.github.com/users/yevheniiminin/received_events","type":"User","site_admin":false},"body":"","created_at":"2016-05-24T13:15:34Z","updated_at":"2016-06-14T14:58:56Z","closed_at":null,"merged_at":null,"merge_commit_sha":"a1637fc29755e98851fbecced10ea49e9735bfcc","assignee":{"login":"cramforce","id":89679,"avatar_url":"https://avatars.githubusercontent.com/u/89679?v=3","gravatar_id":"","url":"https://api.github.com/users/cramforce","html_url":"https://github.com/cramforce","followers_url":"https://api.github.com/users/cramforce/followers","following_url":"https://api.github.com/users/cramforce/following{/other_user}","gists_url":"https://api.github.com/users/cramforce/gists{/gist_id}","starred_url":"https://api.github.com/users/cramforce/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cramforce/subscriptions","organizations_url":"https://api.github.com/users/cramforce/orgs","repos_url":"https://api.github.com/users/cramforce/repos","events_url":"https://api.github.com/users/cramforce/events{/privacy}","received_events_url":"https://api.github.com/users/cramforce/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/ampproject/amphtml/pulls/3305/commits","review_comments_url":"https://api.github.com/repos/ampproject/amphtml/pulls/3305/comments","review_comment_url":"https://api.github.com/repos/ampproject/amphtml/pulls/comments{/number}","comments_url":"https://api.github.com/repos/ampproject/amphtml/issues/3305/comments","statuses_url":"https://api.github.com/repos/ampproject/amphtml/statuses/0ddbd2aa7b9f89605b5b4cb2b8b1e4937eeaebbb","head":{"label":"yevheniiminin:o2player-extension","ref":"o2player-extension","sha":"0ddbd2aa7b9f89605b5b4cb2b8b1e4937eeaebbb","user":{"login":"yevheniiminin","id":15870873,"avatar_url":"https://avatars.githubusercontent.com/u/15870873?v=3","gravatar_id":"","url":"https://api.github.com/users/yevheniiminin","html_url":"https://github.com/yevheniiminin","followers_url":"https://api.github.com/users/yevheniiminin/followers","following_url":"https://api.github.com/users/yevheniiminin/following{/other_user}","gists_url":"https://api.github.com/users/yevheniiminin/gists{/gist_id}","starred_url":"https://api.github.com/users/yevheniiminin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yevheniiminin/subscriptions","organizations_url":"https://api.github.com/users/yevheniiminin/orgs","repos_url":"https://api.github.com/users/yevheniiminin/repos","events_url":"https://api.github.com/users/yevheniiminin/events{/privacy}","received_events_url":"https://api.github.com/users/yevheniiminin/received_events","type":"User","site_admin":false},"repo":{"id":59191237,"name":"amphtml","full_name":"yevheniiminin/amphtml","owner":{"login":"yevheniiminin","id":15870873,"avatar_url":"https://avatars.githubusercontent.com/u/15870873?v=3","gravatar_id":"","url":"https://api.github.com/users/yevheniiminin","html_url":"https://github.com/yevheniiminin","followers_url":"https://api.github.com/users/yevheniiminin/followers","following_url":"https://api.github.com/users/yevheniiminin/following{/other_user}","gists_url":"https://api.github.com/users/yevheniiminin/gists{/gist_id}","starred_url":"https://api.github.com/users/yevheniiminin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yevheniiminin/subscriptions","organizations_url":"https://api.github.com/users/yevheniiminin/orgs","repos_url":"https://api.github.com/users/yevheniiminin/repos","events_url":"https://api.github.com/users/yevheniiminin/events{/privacy}","received_events_url":"https://api.github.com/users/yevheniiminin/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/yevheniiminin/amphtml","description":"AMP HTML source code, samples, and documentation.  See below for more info.","fork":true,"url":"https://api.github.com/repos/yevheniiminin/amphtml","forks_url":"https://api.github.com/repos/yevheniiminin/amphtml/forks","keys_url":"https://api.github.com/repos/yevheniiminin/amphtml/keys{/key_id}","collaborators_url":"https://api.github.com/repos/yevheniiminin/amphtml/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/yevheniiminin/amphtml/teams","hooks_url":"https://api.github.com/repos/yevheniiminin/amphtml/hooks","issue_events_url":"https://api.github.com/repos/yevheniiminin/amphtml/issues/events{/number}","events_url":"https://api.github.com/repos/yevheniiminin/amphtml/events","assignees_url":"https://api.github.com/repos/yevheniiminin/amphtml/assignees{/user}","branches_url":"https://api.github.com/repos/yevheniiminin/amphtml/branches{/branch}","tags_url":"https://api.github.com/repos/yevheniiminin/amphtml/tags","blobs_url":"https://api.github.com/repos/yevheniiminin/amphtml/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/yevheniiminin/amphtml/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/yevheniiminin/amphtml/git/refs{/sha}","trees_url":"https://api.github.com/repos/yevheniiminin/amphtml/git/trees{/sha}","statuses_url":"https://api.github.com/repos/yevheniiminin/amphtml/statuses/{sha}","languages_url":"https://api.github.com/repos/yevheniiminin/amphtml/languages","stargazers_url":"https://api.github.com/repos/yevheniiminin/amphtml/stargazers","contributors_url":"https://api.github.com/repos/yevheniiminin/amphtml/contributors","subscribers_url":"https://api.github.com/repos/yevheniiminin/amphtml/subscribers","subscription_url":"https://api.github.com/repos/yevheniiminin/amphtml/subscription","commits_url":"https://api.github.com/repos/yevheniiminin/amphtml/commits{/sha}","git_commits_url":"https://api.github.com/repos/yevheniiminin/amphtml/git/commits{/sha}","comments_url":"https://api.github.com/repos/yevheniiminin/amphtml/comments{/number}","issue_comment_url":"https://api.github.com/repos/yevheniiminin/amphtml/issues/comments{/number}","contents_url":"https://api.github.com/repos/yevheniiminin/amphtml/contents/{+path}","compare_url":"https://api.github.com/repos/yevheniiminin/amphtml/compare/{base}...{head}","merges_url":"https://api.github.com/repos/yevheniiminin/amphtml/merges","archive_url":"https://api.github.com/repos/yevheniiminin/amphtml/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/yevheniiminin/amphtml/downloads","issues_url":"https://api.github.com/repos/yevheniiminin/amphtml/issues{/number}","pulls_url":"https://api.github.com/repos/yevheniiminin/amphtml/pulls{/number}","milestones_url":"https://api.github.com/repos/yevheniiminin/amphtml/milestones{/number}","notifications_url":"https://api.github.com/repos/yevheniiminin/amphtml/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/yevheniiminin/amphtml/labels{/name}","releases_url":"https://api.github.com/repos/yevheniiminin/amphtml/releases{/id}","deployments_url":"https://api.github.com/repos/yevheniiminin/amphtml/deployments","created_at":"2016-05-19T09:07:30Z","updated_at":"2016-05-19T09:07:34Z","pushed_at":"2016-06-13T11:13:58Z","git_url":"git://github.com/yevheniiminin/amphtml.git","ssh_url":"git@github.com:yevheniiminin/amphtml.git","clone_url":"https://github.com/yevheniiminin/amphtml.git","svn_url":"https://github.com/yevheniiminin/amphtml","homepage":"https://ampproject.org","size":59559,"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":"5b40d684a1ef9ee92d6566e0b4b6da94ca036a6d","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}","deployments_url":"https://api.github.com/repos/ampproject/amphtml/deployments","created_at":"2015-09-01T22:10:53Z","updated_at":"2016-06-14T14:52:49Z","pushed_at":"2016-06-14T06:45:37Z","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":93443,"stargazers_count":7671,"watchers_count":7671,"language":"JavaScript","has_issues":true,"has_downloads":false,"has_wiki":false,"has_pages":false,"forks_count":1057,"mirror_url":null,"open_issues_count":485,"forks":1057,"open_issues":485,"watchers":7671,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/ampproject/amphtml/pulls/3305"},"html":{"href":"https://github.com/ampproject/amphtml/pull/3305"},"issue":{"href":"https://api.github.com/repos/ampproject/amphtml/issues/3305"},"comments":{"href":"https://api.github.com/repos/ampproject/amphtml/issues/3305/comments"},"review_comments":{"href":"https://api.github.com/repos/ampproject/amphtml/pulls/3305/comments"},"review_comment":{"href":"https://api.github.com/repos/ampproject/amphtml/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/ampproject/amphtml/pulls/3305/commits"},"statuses":{"href":"https://api.github.com/repos/ampproject/amphtml/statuses/0ddbd2aa7b9f89605b5b4cb2b8b1e4937eeaebbb"}}}}
{"actor":{"display_login":"cramforce"}}