Add custom poster frame to youtube video without the API
The trick is adding the iframe in a comment. Javascript reads comment contents and saves iframe definition to a var. When user clicks on the image, javascript overwrites container innerHTML using the iframe defined in the comments.
https://gist.github.com/4438876
This code is also valid in browsers not supporting window.postMessage (API uses postMessage).
Written by Sergi Meseguer
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Postmessage
Authors
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#