Title: [171028] trunk/Source/WebCore
Revision
171028
Author
[email protected]
Date
2014-07-12 14:17:50 -0700 (Sat, 12 Jul 2014)

Log Message

[iOS Media] Start playback button should indicate when it can't play
https://bugs.webkit.org/show_bug.cgi?id=134851

Reviewed by Sam Weinig.

If a video element has errors and cannot play, then the start
playback button should use the "broken" icon.

* Modules/mediacontrols/mediaControlsApple.js: Add a new "failed" class.
* Modules/mediacontrols/mediaControlsiOS.js:
(ControllerIOS.prototype.shouldHaveStartPlaybackButton): We need a playback button
even when there is an error.
(ControllerIOS.prototype.handleWirelessPickerButtonTouchStart): Don't offer Airplay
if we're in an error state.
(ControllerIOS.prototype.updateStatusDisplay): Set the "failed" class on
the playback buttons if we are in an error state.

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (171027 => 171028)


--- trunk/Source/WebCore/ChangeLog	2014-07-12 20:40:17 UTC (rev 171027)
+++ trunk/Source/WebCore/ChangeLog	2014-07-12 21:17:50 UTC (rev 171028)
@@ -1,3 +1,22 @@
+2014-07-11  Dean Jackson  <[email protected]>
+
+        [iOS Media] Start playback button should indicate when it can't play
+        https://bugs.webkit.org/show_bug.cgi?id=134851
+
+        Reviewed by Sam Weinig.
+
+        If a video element has errors and cannot play, then the start
+        playback button should use the "broken" icon.
+
+        * Modules/mediacontrols/mediaControlsApple.js: Add a new "failed" class.
+        * Modules/mediacontrols/mediaControlsiOS.js:
+        (ControllerIOS.prototype.shouldHaveStartPlaybackButton): We need a playback button
+        even when there is an error.
+        (ControllerIOS.prototype.handleWirelessPickerButtonTouchStart): Don't offer Airplay
+        if we're in an error state.
+        (ControllerIOS.prototype.updateStatusDisplay): Set the "failed" class on
+        the playback buttons if we are in an error state.
+
 2014-07-11  Benjamin Poulain  <[email protected]>
 
         Partition the CSS rules based on the most specific filter of the rightmost fragment

Modified: trunk/Source/WebCore/Modules/mediacontrols/mediaControlsApple.js (171027 => 171028)


--- trunk/Source/WebCore/Modules/mediacontrols/mediaControlsApple.js	2014-07-12 20:40:17 UTC (rev 171027)
+++ trunk/Source/WebCore/Modules/mediacontrols/mediaControlsApple.js	2014-07-12 21:17:50 UTC (rev 171028)
@@ -71,6 +71,7 @@
     ClassNames: {
         active: 'active',
         exit: 'exit',
+        failed: 'failed',
         hidden: 'hidden',
         hiding: 'hiding',
         hourLongTime: 'hour-long-time',

Modified: trunk/Source/WebCore/Modules/mediacontrols/mediaControlsiOS.js (171027 => 171028)


--- trunk/Source/WebCore/Modules/mediacontrols/mediaControlsiOS.js	2014-07-12 20:40:17 UTC (rev 171027)
+++ trunk/Source/WebCore/Modules/mediacontrols/mediaControlsiOS.js	2014-07-12 21:17:50 UTC (rev 171028)
@@ -78,6 +78,9 @@
         if (!this.video.controls && allowsInline)
             return false;
 
+        if (this.video.currentSrc && this.video.error)
+            return true;
+
         if (!this.host.userGestureRequired && allowsInline)
             return false;
 
@@ -415,7 +418,8 @@
     },
 
     handleWirelessPickerButtonTouchStart: function() {
-        this.controls.wirelessTargetPicker.classList.add('active');
+        if (!this.video.error)
+            this.controls.wirelessTargetPicker.classList.add('active');
     },
 
     handleWirelessPickerButtonTouchEnd: function(event) {
@@ -429,6 +433,13 @@
         return true;
     },
 
+    updateStatusDisplay: function(event)
+    {
+        this.controls.playButton.classList.toggle(this.ClassNames.failed, this.video.error !== null);
+        this.controls.startPlaybackButton.classList.toggle(this.ClassNames.failed, this.video.error !== null);
+        Controller.prototype.updateStatusDisplay.call(this, event);
+    },
+
     get pageScaleFactor() {
         return this._pageScaleFactor;
     },
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to