{"action":"created","issue":{"url":"https://api.github.com/repos/ampproject/amphtml/issues/1361","labels_url":"https://api.github.com/repos/ampproject/amphtml/issues/1361/labels{/name}","comments_url":"https://api.github.com/repos/ampproject/amphtml/issues/1361/comments","events_url":"https://api.github.com/repos/ampproject/amphtml/issues/1361/events","html_url":"https://github.com/ampproject/amphtml/issues/1361","id":125693359,"number":1361,"title":"Click to play not working","user":{"login":"maxhartshorn","id":8988954,"avatar_url":"https://avatars.githubusercontent.com/u/8988954?v=3","gravatar_id":"","url":"https://api.github.com/users/maxhartshorn","html_url":"https://github.com/maxhartshorn","followers_url":"https://api.github.com/users/maxhartshorn/followers","following_url":"https://api.github.com/users/maxhartshorn/following{/other_user}","gists_url":"https://api.github.com/users/maxhartshorn/gists{/gist_id}","starred_url":"https://api.github.com/users/maxhartshorn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/maxhartshorn/subscriptions","organizations_url":"https://api.github.com/users/maxhartshorn/orgs","repos_url":"https://api.github.com/users/maxhartshorn/repos","events_url":"https://api.github.com/users/maxhartshorn/events{/privacy}","received_events_url":"https://api.github.com/users/maxhartshorn/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/ampproject/amphtml/labels/Question","name":"Question","color":"207de5"},{"url":"https://api.github.com/repos/ampproject/amphtml/labels/Related%20to:%20Documentation","name":"Related to: Documentation","color":"d4c5f9"},{"url":"https://api.github.com/repos/ampproject/amphtml/labels/Request","name":"Request","color":"207de5"},{"url":"https://api.github.com/repos/ampproject/amphtml/labels/Type:%20Enhancement","name":"Type: Enhancement","color":"fef2c0"}],"state":"open","locked":false,"assignee":{"login":"sriramkrish85","id":1037311,"avatar_url":"https://avatars.githubusercontent.com/u/1037311?v=3","gravatar_id":"","url":"https://api.github.com/users/sriramkrish85","html_url":"https://github.com/sriramkrish85","followers_url":"https://api.github.com/users/sriramkrish85/followers","following_url":"https://api.github.com/users/sriramkrish85/following{/other_user}","gists_url":"https://api.github.com/users/sriramkrish85/gists{/gist_id}","starred_url":"https://api.github.com/users/sriramkrish85/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sriramkrish85/subscriptions","organizations_url":"https://api.github.com/users/sriramkrish85/orgs","repos_url":"https://api.github.com/users/sriramkrish85/repos","events_url":"https://api.github.com/users/sriramkrish85/events{/privacy}","received_events_url":"https://api.github.com/users/sriramkrish85/received_events","type":"User","site_admin":false},"milestone":null,"comments":2,"created_at":"2016-01-08T21:05:50Z","updated_at":"2016-01-12T19:42:52Z","closed_at":null,"body":"As I understand it, the idea of Click To Play iframe functionality is to display a placeholder image which the user needs to click on in order to display the iframe content. A use case would be displaying a placeholder screenshot over an iframed video player. Clicking the screenshot would trigger the video player.\r\n\r\nThis is not how it is currently working in Chrome. When I run test/manual/amp-iframe-clicktoplay.html. The specified iframe loads with the placeholder image as one would expect. Once the iframe is loaded the placeholder is removed and the rest of the iframe is loaded automatically. This is useful in many cases, but it is certainly not \"click\" to play functionality.\r\n\r\nLooking at the code it's apparent that the Click To Play placeholder is simply being removed the iframe's onload event: \r\n\r\n```javascript\r\n iframe.onload = () => {\r\n      // Chrome does not reflect the iframe readystate.\r\n      iframe.readyState = 'complete';\r\n      this.activateIframe_();\r\n };\r\n\r\n```\r\n...\r\n\r\n```javascript\r\n/**\r\n   * Makes the iframe visible.\r\n   * @private\r\n   */\r\n  activateIframe_() {\r\n    this.getVsync().mutate(() => {\r\n      if (this.placeholder_) {\r\n        this.iframe_.style.zIndex = '';\r\n        removeElement(this.placeholder_);\r\n        this.placeholder_ = null;\r\n      }\r\n    });\r\n  }\r\n\r\n```\r\n\r\nIs your intention to implement Click To Play functionality on our iframes eventually? That would be a useful feature. If not, why call it Click to Play?"},"comment":{"url":"https://api.github.com/repos/ampproject/amphtml/issues/comments/171030632","html_url":"https://github.com/ampproject/amphtml/issues/1361#issuecomment-171030632","issue_url":"https://api.github.com/repos/ampproject/amphtml/issues/1361","id":171030632,"user":{"login":"rudygalfi","id":3888212,"avatar_url":"https://avatars.githubusercontent.com/u/3888212?v=3","gravatar_id":"","url":"https://api.github.com/users/rudygalfi","html_url":"https://github.com/rudygalfi","followers_url":"https://api.github.com/users/rudygalfi/followers","following_url":"https://api.github.com/users/rudygalfi/following{/other_user}","gists_url":"https://api.github.com/users/rudygalfi/gists{/gist_id}","starred_url":"https://api.github.com/users/rudygalfi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rudygalfi/subscriptions","organizations_url":"https://api.github.com/users/rudygalfi/orgs","repos_url":"https://api.github.com/users/rudygalfi/repos","events_url":"https://api.github.com/users/rudygalfi/events{/privacy}","received_events_url":"https://api.github.com/users/rudygalfi/received_events","type":"User","site_admin":false},"created_at":"2016-01-12T19:42:52Z","updated_at":"2016-01-12T19:42:52Z","body":"Closed by #1386"}}