YouTube iFrame-JavaScript API

RESPONSIVE. Default size: 854px x 480px


See "page source" to observe the coding in this.

Added some things from the example at developers.google.com/youtube/iframe_api_reference

Events Capture

onReady
onStateChange
onError



Oct 29, 2014: Few times, you'll notice this error on Chrome console:

Failed to execute 'postMessage' on 'DOMWindow': The target origin provided ('https://www.youtube.com') does not match the recipient window's origin ('this_window_url')

It's filed there:
code.google.com/p/gdata-issues/issues/detail?id=5788
I dunno how to resolve that.
You might be interested in these:
  • YouTube iframe API: how do I control a iframe player that's already in the HTML?
    stackoverflow.com/questions/7443578/youtube-iframe-api-how-do-i-control-a-iframe-player-thats-already-in-the-html
  • Force HTML5 video for embedded YouTube video:
    stackoverflow.com/questions/5845484/force-html5-youtube-video