[iOS] Scrubber display is broken if the buffered range is empty
authordino@apple.com <dino@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 2 May 2015 00:55:03 +0000 (00:55 +0000)
committerdino@apple.com <dino@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 2 May 2015 00:55:03 +0000 (00:55 +0000)
https://bugs.webkit.org/show_bug.cgi?id=144511

Reviewed by Eric Carlson.

Make sure that if video.buffered returns an empty list, we
still draw the scrubber background correctly.

* Modules/mediacontrols/mediaControlsiOS.js:
(ControllerIOS.prototype.drawTimelineBackground): Ensure that buffered
is always at least as big as the current time.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@183704 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebCore/ChangeLog
Source/WebCore/Modules/mediacontrols/mediaControlsiOS.js

index 86b60d8..37aa9b3 100644 (file)
@@ -1,3 +1,17 @@
+2015-05-01  Dean Jackson  <dino@apple.com>
+
+        [iOS] Scrubber display is broken if the buffered range is empty
+        https://bugs.webkit.org/show_bug.cgi?id=144511
+
+        Reviewed by Eric Carlson.
+
+        Make sure that if video.buffered returns an empty list, we
+        still draw the scrubber background correctly.
+
+        * Modules/mediacontrols/mediaControlsiOS.js:
+        (ControllerIOS.prototype.drawTimelineBackground): Ensure that buffered
+        is always at least as big as the current time.
+
 2015-05-01  Roger Fong  <roger_fong@apple.com>
 
         Media control volume slider should be vertical to avoid flickering issues.
index 2d06e0a..fc68de9 100644 (file)
@@ -252,6 +252,7 @@ ControllerIOS.prototype = {
             buffered = Math.max(bufferedRanges.end(bufferedRanges.length - 1), buffered);
 
         buffered /= this.video.duration;
+        buffered = Math.max(buffered, played);
 
         var ctx = this.video.ownerDocument.getCSSCanvasContext('2d', this.timelineContextName, width, height);