Permalink
Browse files

make sure buffer fraction is 0..1

  • Loading branch information...
Carl Fürstenberg
Carl Fürstenberg committed Mar 21, 2010
1 parent 56f4f1d commit 593556e6494641cb184f4559d8a134443f814aba
Showing with 3 additions and 1 deletion.
  1. +3 −1 jquery.video.js
View
@@ -353,7 +353,9 @@ $.widget("ui.video", {
total = e.originalEvent.total;
if( lengthComputable ) {
- this.bufferStatus.width(loaded/total * this.scrubberSliderAbsoluteWidth);
+ var fraction = Math.max(Math.min(loaded / total,1),0);
+
+ this.bufferStatus.width(Math.max(fraction * this.scrubberSliderAbsoluteWidth));
}
},

0 comments on commit 593556e

Please sign in to comment.