Universal Player and the JavaScript API
Today we announced the availability of our new Universal Player which allows just about any device to view a Vimeo video embedded on any blog. To achieve this, we used the iframe HTML element. While iframes are great for allowing you to host external content on a different site, they also come with a huge set of browser limitations in terms of security.
One of these limitations is that a parent HTML document cannot access any of an iframe’s content, and vice versa. This is a pretty big issue if you had been using our JavaScript API to listen to events from our player or to control our player directly since this cannot be done with iframes. The only way to communicate with iframes is through the use of window.postMessage.
However, window.postMessage is incredibly complex and somewhat limiting. To ease the pain, we’ve written a small JavaScript framework called Froogaloop to help. Simply call the api or addEvent methods and you’re on your way.
To see the full documentation on how to gain JavaScript API acces with the Universal Player, be sure to visit our documentation on the Moogaloop API page, or go ahead and give it a whirl by downloading it from our GitHub page.