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

Commit f0d1130

Browse files
author
Shaker Islam
committed
in case there's an invalid duration in the VAST file, let's fall back to video.js goodies
1 parent be6b112 commit f0d1130

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

videojs.vast.js

+6-1
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,12 @@
5454
player.vast.sources = player.vast.createSourceObjects(linearCreative.mediaFiles);
5555
player.vastTracker = new vast.tracker(ad, linearCreative);
5656
player.on('canplay', function() {this.vastTracker.load();});
57-
player.on('timeupdate', function() {this.vastTracker.setProgress(this.currentTime());});
57+
player.on('timeupdate', function() {
58+
if (isNaN(linearCreative.duration)) {
59+
linearCreative.duration = this.duration();
60+
}
61+
this.vastTracker.setProgress(this.currentTime());
62+
});
5863
player.on('play', function() {this.vastTracker.setPaused(false);});
5964
player.on('pause', function() {this.vastTracker.setPaused(true);});
6065
break;

0 commit comments

Comments
 (0)