Skip to content
This repository has been archived by the owner on Feb 13, 2019. It is now read-only.

Commit

Permalink
in case there's an invalid duration in the VAST file, let's fall back…
Browse files Browse the repository at this point in the history
… to video.js goodies
  • Loading branch information
Shaker Islam committed Mar 12, 2014
1 parent be6b112 commit f0d1130
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion videojs.vast.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,12 @@
player.vast.sources = player.vast.createSourceObjects(linearCreative.mediaFiles);
player.vastTracker = new vast.tracker(ad, linearCreative);
player.on('canplay', function() {this.vastTracker.load();});
player.on('timeupdate', function() {this.vastTracker.setProgress(this.currentTime());});
player.on('timeupdate', function() {
if (isNaN(linearCreative.duration)) {
linearCreative.duration = this.duration();
}
this.vastTracker.setProgress(this.currentTime());
});
player.on('play', function() {this.vastTracker.setPaused(false);});
player.on('pause', function() {this.vastTracker.setPaused(true);});
break;
Expand Down

0 comments on commit f0d1130

Please sign in to comment.