Introduction & Setup

The API allows you to control, and get information about, media playback and the player itself.

Enable the JS API

All you need to do to enable the JavaScript API is include the vzaar library before the closing </body> tag on your website:

<script src="" type="text/javascript"></script>


To use the JS API, instantiate a vzPlayer object by passing it the ID of a video's iframe, then wrap your code in an anonymous function passed to the ready() function, like so:

// Pass the ID of your video's iframe
var vzp = new vzPlayer("vzvd-10355742");

// Ensure the video is ready to accept commands
vzp.ready(function() {
  // Your code



The JS API relies on the id and name attributes in the iframe to be the same (e.g. vzvd-1234567) and changing either may result in unexpected behavior.