videojs/videojs-contrib-ads — pull request #13 by dmlap (2013-11-10 23:55:43+00:00)
Title: Use a single play cancellation timeout and clear it when leaving `preroll?`

When the preroll timeout expired but a cancelPlay timeout was still scheduled, the content video would be paused. This change creates a single, player-level cancellation timeout that is cleared as soon as the ad plugin determines whether to play prerolls or not. Previously, the plugin made sure that cancelPlays did not take effect if a preroll began playing but they could still affect playback if there wasn't a preroll. Added a test case that demonstrates the problem scenario.