brightcove/videojs-ads — pull request #10 by bcjwilson (2013-10-03 21:19:11+00:00)
Title: bugfix/contentupdate

Fixes #2

PR includes:

* Implementation of `contentupdate` event in videojs.ads.js.
* QUnit tests for contentupdate in various playback states.
* Updated `example/` which includes a form for overriding the src at runtime and logs contentupdate events to the screen.
* Update to README pursuant to new functionality.

To manually confirm this fix:

* Check out this branch (bugfix/contentupdate).
* Open `example/index.html` in a browser (preferably served over HTTP).
* Confirm one `contentupdate` event as shown in the `

` tag in-page.
* Play video.
* Allow video to play through preroll and into content.
* Confirm still just one `contentupdate` event.
* Pause video (during content, not during ad playback).
* Click/tap the **set src** button to programmatically set a new content video.
* Confirm second `contentupdate` event.
* Play video.
* Confirm that preroll plays followed by new content video.

Caveats:

* If you click **set src** during ad playback, you will not see a contentupdate event and you will put the player into a bad state. While the ad implementation has control of the player, it is responsible for handling out-of-band changes to player state. The simple example ad integration doesn't do this. (see #9)
* If you click **set src** during content playback while the video is playing (not paused), you'll see that the video does not automatically start playing the new content, and the controls will appear in the playing state even though the video is paused. This is a video.js bug (see [video.js #765](https://github.com/videojs/video.js/issues/765))