You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
This 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.
Looking at the code it's apparent that the Click To Play placeholder is simply being removed the iframe's onload event:
iframe.onload=()=>{// Chrome does not reflect the iframe readystate.iframe.readyState='complete';this.activateIframe_();};
...
/** * Makes the iframe visible. * @private */activateIframe_(){this.getVsync().mutate(()=>{if(this.placeholder_){this.iframe_.style.zIndex='';removeElement(this.placeholder_);this.placeholder_=null;}});}
Is 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?
The text was updated successfully, but these errors were encountered:
@maxhartshorn Thanks for raising this. For context, raised this in the original Intent to Implement (#571 (comment)).
Yes, I think we should either update the docs to avoid using the "click-to-play" terminology (since there's no click required) or implement behavior where the rendering of the iframe will block on a click/tap. Or do both.
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.
This 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.
Looking at the code it's apparent that the Click To Play placeholder is simply being removed the iframe's onload event:
...
Is 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?
The text was updated successfully, but these errors were encountered: