{"action":"created","comment":{"url":"https://api.github.com/repos/ampproject/amphtml/pulls/comments/55566190","id":55566190,"diff_hunk":"@@ -0,0 +1,139 @@\n+/**\n+ * Copyright 2015 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 {setStyles} from '../../../src/style';\n+\n+class AmpSpringboardPlayer extends AMP.BaseElement {\n+\n+  /** @override */\n+  createdCallback() {\n+    this.preconnect.url('https://cms.springboardplatform.com');\n+    this.preconnect.url('https://www.springboardplatform.com');\n+  }\n+\n+  /** @override */\n+  isLayoutSupported(layout) {\n+    return isLayoutSizeDefined(layout);\n+  }\n+\n+  /** @override */\n+  buildCallback() {\n+    const width = this.element.getAttribute('width');\n+    const height = this.element.getAttribute('height');\n+    const mode = AMP.assert(\n+        this.element.getAttribute('data-mode'),\n+        'The data-mode attribute is required for <amp-springboard-player> %s',\n+        this.element);\n+    const contentId = AMP.assert(\n+        this.element.getAttribute('data-content-id'),\n+        'The data-content-id attribute is required for' +\n+        '<amp-springboard-player> %s',\n+        this.element);\n+    const domain = AMP.assert(\n+        this.element.getAttribute('data-domain'),\n+        'The data-domain attribute is required for <amp-springboard-player> %s',\n+        this.element);\n+\n+    this.width_ = width;\n+    this.height_ = height;\n+    this.mode_ = mode;\n+    this.contentId_ = contentId;\n+    this.domain_ = domain;\n+\n+    if (!this.getPlaceholder()) {\n+      this.buildImagePlaceholder_();\n+    }\n+  }\n+\n+  /** @override */\n+  layoutCallback() {\n+    const iframe = document.createElement('iframe');\n+    const siteId = AMP.assert(\n+        this.element.getAttribute('data-site-id'),\n+        'The data-site-id attribute is required for' +\n+        '<amp-springboard-player> %s',\n+        this.element);\n+    const playerId = AMP.assert(\n+        this.element.getAttribute('data-player-id'),\n+        'The data-player-id attribute is required for' +\n+        '<amp-springboard-player> %s',\n+        this.element);\n+    const items = this.element.getAttribute('data-items') || '10';\n+\n+    iframe.setAttribute('frameborder', '0');\n+    iframe.setAttribute('allowfullscreen', 'true');\n+    iframe.id = playerId + '_' + this.contentId_;\n+    iframe.src = 'https://cms.springboardplatform.com/embed_iframe/' +\n+    \tencodeURIComponent(siteId) + '/' + encodeURIComponent(this.mode_) +\n+    \t'/' + encodeURIComponent(this.contentId_) + '/' +\n+    \tencodeURIComponent(playerId) + '/' + encodeURIComponent(this.domain_) +\n+    \t'/' + encodeURIComponent(items);\n+    this.applyFillContent(iframe);\n+    iframe.width = this.width_;\n+    iframe.height = this.height_;\n+    /** @private {?Element} */\n+    this.iframe_ = iframe;\n+    this.element.appendChild(iframe);\n+    return loadPromise(iframe);\n+  }\n+\n+  /** @override */\n+  documentInactiveCallback() {\n+    if (this.iframe_ && this.iframe_.contentWindow) {\n+      this.iframe_.contentWindow./*OK*/postMessage('ampPause', '*');\n+    }\n+    return false;\n+  }\n+\n+  /** @private */\n+  buildImagePlaceholder_() {\n+    const imgPlaceholder = new Image();\n+\n+    setStyles(imgPlaceholder, {\n+      //Cover matches YouTube Player styling.","path":"extensions/amp-springboard-player/0.1/amp-springboard-player.js","position":108,"original_position":108,"commit_id":"4c43033b11cd820e2545a0d2f6beb7bb2753f62f","original_commit_id":"4c43033b11cd820e2545a0d2f6beb7bb2753f62f","user":{"login":"mkhatib","id":2647,"avatar_url":"https://avatars.githubusercontent.com/u/2647?v=3","gravatar_id":"","url":"https://api.github.com/users/mkhatib","html_url":"https://github.com/mkhatib","followers_url":"https://api.github.com/users/mkhatib/followers","following_url":"https://api.github.com/users/mkhatib/following{/other_user}","gists_url":"https://api.github.com/users/mkhatib/gists{/gist_id}","starred_url":"https://api.github.com/users/mkhatib/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mkhatib/subscriptions","organizations_url":"https://api.github.com/users/mkhatib/orgs","repos_url":"https://api.github.com/users/mkhatib/repos","events_url":"https://api.github.com/users/mkhatib/events{/privacy}","received_events_url":"https://api.github.com/users/mkhatib/received_events","type":"User","site_admin":false},"body":"Fix the comments referring to YouTube. \r\n\r\nAnd make sure the styling actually matches the springboard player - this means when the placeholder image gets hidden it needs to be the exact poster image of the video rather than having different styling - you can test this by throttling the network in chrome devtools and loading the example and noticing that the image placeholder first loads and then gets replaced by the video. \r\n\r\nJust make sure the styling doesn't differ too much.","created_at":"2016-03-09T18:40:05Z","updated_at":"2016-03-09T18:40:05Z","html_url":"https://github.com/ampproject/amphtml/pull/2467#discussion_r55566190","pull_request_url":"https://api.github.com/repos/ampproject/amphtml/pulls/2467","_links":{"self":{"href":"https://api.github.com/repos/ampproject/amphtml/pulls/comments/55566190"},"html":{"href":"https://github.com/ampproject/amphtml/pull/2467#discussion_r55566190"},"pull_request":{"href":"https://api.github.com/repos/ampproject/amphtml/pulls/2467"}}},"pull_request":{"url":"https://api.github.com/repos/ampproject/amphtml/pulls/2467","id":61843883,"html_url":"https://github.com/ampproject/amphtml/pull/2467","diff_url":"https://github.com/ampproject/amphtml/pull/2467.diff","patch_url":"https://github.com/ampproject/amphtml/pull/2467.patch","issue_url":"https://api.github.com/repos/ampproject/amphtml/issues/2467","number":2467,"state":"open","locked":false,"title":"Springboard player component (amp-springboard-player)","user":{"login":"Em-PredragMilosevic","id":10281172,"avatar_url":"https://avatars.githubusercontent.com/u/10281172?v=3","gravatar_id":"","url":"https://api.github.com/users/Em-PredragMilosevic","html_url":"https://github.com/Em-PredragMilosevic","followers_url":"https://api.github.com/users/Em-PredragMilosevic/followers","following_url":"https://api.github.com/users/Em-PredragMilosevic/following{/other_user}","gists_url":"https://api.github.com/users/Em-PredragMilosevic/gists{/gist_id}","starred_url":"https://api.github.com/users/Em-PredragMilosevic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Em-PredragMilosevic/subscriptions","organizations_url":"https://api.github.com/users/Em-PredragMilosevic/orgs","repos_url":"https://api.github.com/users/Em-PredragMilosevic/repos","events_url":"https://api.github.com/users/Em-PredragMilosevic/events{/privacy}","received_events_url":"https://api.github.com/users/Em-PredragMilosevic/received_events","type":"User","site_admin":false},"body":"The amp-springboard-player component. (Intent to implement: <a href=\"https://github.com/ampproject/amphtml/issues/2410\">Issue #2410 </a>).\r\n\r\nThanks","created_at":"2016-03-06T14:20:52Z","updated_at":"2016-03-09T18:40:05Z","closed_at":null,"merged_at":null,"merge_commit_sha":"fbd5625ad61981679623424eb8bb7583fdba2281","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/ampproject/amphtml/pulls/2467/commits","review_comments_url":"https://api.github.com/repos/ampproject/amphtml/pulls/2467/comments","review_comment_url":"https://api.github.com/repos/ampproject/amphtml/pulls/comments{/number}","comments_url":"https://api.github.com/repos/ampproject/amphtml/issues/2467/comments","statuses_url":"https://api.github.com/repos/ampproject/amphtml/statuses/4c43033b11cd820e2545a0d2f6beb7bb2753f62f","head":{"label":"Em-PredragMilosevic:master","ref":"master","sha":"4c43033b11cd820e2545a0d2f6beb7bb2753f62f","user":{"login":"Em-PredragMilosevic","id":10281172,"avatar_url":"https://avatars.githubusercontent.com/u/10281172?v=3","gravatar_id":"","url":"https://api.github.com/users/Em-PredragMilosevic","html_url":"https://github.com/Em-PredragMilosevic","followers_url":"https://api.github.com/users/Em-PredragMilosevic/followers","following_url":"https://api.github.com/users/Em-PredragMilosevic/following{/other_user}","gists_url":"https://api.github.com/users/Em-PredragMilosevic/gists{/gist_id}","starred_url":"https://api.github.com/users/Em-PredragMilosevic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Em-PredragMilosevic/subscriptions","organizations_url":"https://api.github.com/users/Em-PredragMilosevic/orgs","repos_url":"https://api.github.com/users/Em-PredragMilosevic/repos","events_url":"https://api.github.com/users/Em-PredragMilosevic/events{/privacy}","received_events_url":"https://api.github.com/users/Em-PredragMilosevic/received_events","type":"User","site_admin":false},"repo":{"id":52949684,"name":"amphtml","full_name":"Em-PredragMilosevic/amphtml","owner":{"login":"Em-PredragMilosevic","id":10281172,"avatar_url":"https://avatars.githubusercontent.com/u/10281172?v=3","gravatar_id":"","url":"https://api.github.com/users/Em-PredragMilosevic","html_url":"https://github.com/Em-PredragMilosevic","followers_url":"https://api.github.com/users/Em-PredragMilosevic/followers","following_url":"https://api.github.com/users/Em-PredragMilosevic/following{/other_user}","gists_url":"https://api.github.com/users/Em-PredragMilosevic/gists{/gist_id}","starred_url":"https://api.github.com/users/Em-PredragMilosevic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Em-PredragMilosevic/subscriptions","organizations_url":"https://api.github.com/users/Em-PredragMilosevic/orgs","repos_url":"https://api.github.com/users/Em-PredragMilosevic/repos","events_url":"https://api.github.com/users/Em-PredragMilosevic/events{/privacy}","received_events_url":"https://api.github.com/users/Em-PredragMilosevic/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/Em-PredragMilosevic/amphtml","description":"AMP HTML source code, samples, and documentation.  See below for more info.","fork":true,"url":"https://api.github.com/repos/Em-PredragMilosevic/amphtml","forks_url":"https://api.github.com/repos/Em-PredragMilosevic/amphtml/forks","keys_url":"https://api.github.com/repos/Em-PredragMilosevic/amphtml/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Em-PredragMilosevic/amphtml/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Em-PredragMilosevic/amphtml/teams","hooks_url":"https://api.github.com/repos/Em-PredragMilosevic/amphtml/hooks","issue_events_url":"https://api.github.com/repos/Em-PredragMilosevic/amphtml/issues/events{/number}","events_url":"https://api.github.com/repos/Em-PredragMilosevic/amphtml/events","assignees_url":"https://api.github.com/repos/Em-PredragMilosevic/amphtml/assignees{/user}","branches_url":"https://api.github.com/repos/Em-PredragMilosevic/amphtml/branches{/branch}","tags_url":"https://api.github.com/repos/Em-PredragMilosevic/amphtml/tags","blobs_url":"https://api.github.com/repos/Em-PredragMilosevic/amphtml/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Em-PredragMilosevic/amphtml/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Em-PredragMilosevic/amphtml/git/refs{/sha}","trees_url":"https://api.github.com/repos/Em-PredragMilosevic/amphtml/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Em-PredragMilosevic/amphtml/statuses/{sha}","languages_url":"https://api.github.com/repos/Em-PredragMilosevic/amphtml/languages","stargazers_url":"https://api.github.com/repos/Em-PredragMilosevic/amphtml/stargazers","contributors_url":"https://api.github.com/repos/Em-PredragMilosevic/amphtml/contributors","subscribers_url":"https://api.github.com/repos/Em-PredragMilosevic/amphtml/subscribers","subscription_url":"https://api.github.com/repos/Em-PredragMilosevic/amphtml/subscription","commits_url":"https://api.github.com/repos/Em-PredragMilosevic/amphtml/commits{/sha}","git_commits_url":"https://api.github.com/repos/Em-PredragMilosevic/amphtml/git/commits{/sha}","comments_url":"https://api.github.com/repos/Em-PredragMilosevic/amphtml/comments{/number}","issue_comment_url":"https://api.github.com/repos/Em-PredragMilosevic/amphtml/issues/comments{/number}","contents_url":"https://api.github.com/repos/Em-PredragMilosevic/amphtml/contents/{+path}","compare_url":"https://api.github.com/repos/Em-PredragMilosevic/amphtml/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Em-PredragMilosevic/amphtml/merges","archive_url":"https://api.github.com/repos/Em-PredragMilosevic/amphtml/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Em-PredragMilosevic/amphtml/downloads","issues_url":"https://api.github.com/repos/Em-PredragMilosevic/amphtml/issues{/number}","pulls_url":"https://api.github.com/repos/Em-PredragMilosevic/amphtml/pulls{/number}","milestones_url":"https://api.github.com/repos/Em-PredragMilosevic/amphtml/milestones{/number}","notifications_url":"https://api.github.com/repos/Em-PredragMilosevic/amphtml/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Em-PredragMilosevic/amphtml/labels{/name}","releases_url":"https://api.github.com/repos/Em-PredragMilosevic/amphtml/releases{/id}","deployments_url":"https://api.github.com/repos/Em-PredragMilosevic/amphtml/deployments","created_at":"2016-03-02T09:14:34Z","updated_at":"2016-03-02T09:14:36Z","pushed_at":"2016-03-09T13:34:10Z","git_url":"git://github.com/Em-PredragMilosevic/amphtml.git","ssh_url":"git@github.com:Em-PredragMilosevic/amphtml.git","clone_url":"https://github.com/Em-PredragMilosevic/amphtml.git","svn_url":"https://github.com/Em-PredragMilosevic/amphtml","homepage":"https://ampproject.org","size":30634,"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":"c54f8a7db9206d0dcd9e45710f99ef5eea629dca","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-03-09T18:37:02Z","pushed_at":"2016-03-09T18:29:00Z","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":36202,"stargazers_count":6698,"watchers_count":6698,"language":"JavaScript","has_issues":true,"has_downloads":false,"has_wiki":false,"has_pages":false,"forks_count":810,"mirror_url":null,"open_issues_count":351,"forks":810,"open_issues":351,"watchers":6698,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/ampproject/amphtml/pulls/2467"},"html":{"href":"https://github.com/ampproject/amphtml/pull/2467"},"issue":{"href":"https://api.github.com/repos/ampproject/amphtml/issues/2467"},"comments":{"href":"https://api.github.com/repos/ampproject/amphtml/issues/2467/comments"},"review_comments":{"href":"https://api.github.com/repos/ampproject/amphtml/pulls/2467/comments"},"review_comment":{"href":"https://api.github.com/repos/ampproject/amphtml/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/ampproject/amphtml/pulls/2467/commits"},"statuses":{"href":"https://api.github.com/repos/ampproject/amphtml/statuses/4c43033b11cd820e2545a0d2f6beb7bb2753f62f"}}}}