]> khamidou — GitHub mirrors - popcorn-js.git/commitdiff
isNaN(video.duration) fix [#235]
authorAnna Sobiepanek <annaopensource@gmail.com>
Wed, 16 Feb 2011 17:06:45 +0000 (12:06 -0500)
committerAnna Sobiepanek <annaopensource@gmail.com>
Wed, 16 Feb 2011 17:06:45 +0000 (12:06 -0500)
popcorn.js

index 9f63c0c3967a259a0bec1bc8adda073887f1460a..012d8e579159111d8ac2dfb7f61fe1ac31db93f2 100644 (file)
           // adding padding to the front and end of the arrays
           // this is so we do not fall off either end
 
-          var videoDurationPlus = that.video.duration + 1;
+          var duration = that.video.duration;
+          // Check for no duration info (NaN)
+          var videoDurationPlus = duration != duration ? Number.MAX_VALUE : duration + 1;
+
           Popcorn.addTrackEvent( that, {
             start: videoDurationPlus,
             end: videoDurationPlus