Title: [212940] trunk/Source/WebCore
Revision
212940
Author
commit-qu...@webkit.org
Date
2017-02-23 21:27:54 -0800 (Thu, 23 Feb 2017)

Log Message

[Modern Media Controls] Show "Loading" until playback starts
https://bugs.webkit.org/show_bug.cgi?id=168809
<rdar://problem/30687468>

Patch by Antoine Quint <grao...@apple.com> on 2017-02-23
Reviewed by Jon Lee.

We now display the "Loading" status as soon as we've started loading and
until we've obtained enough data to play. No test provided since we don't
have a way to specifically set networkState and readyState to the satisfactory
values.

* Modules/modern-media-controls/media/status-support.js:
(StatusSupport.prototype.syncControl):
(StatusSupport):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (212939 => 212940)


--- trunk/Source/WebCore/ChangeLog	2017-02-24 04:07:30 UTC (rev 212939)
+++ trunk/Source/WebCore/ChangeLog	2017-02-24 05:27:54 UTC (rev 212940)
@@ -1,5 +1,22 @@
 2017-02-23  Antoine Quint  <grao...@apple.com>
 
+        [Modern Media Controls] Show "Loading" until playback starts
+        https://bugs.webkit.org/show_bug.cgi?id=168809
+        <rdar://problem/30687468>
+
+        Reviewed by Jon Lee.
+
+        We now display the "Loading" status as soon as we've started loading and
+        until we've obtained enough data to play. No test provided since we don't
+        have a way to specifically set networkState and readyState to the satisfactory
+        values.
+
+        * Modules/modern-media-controls/media/status-support.js:
+        (StatusSupport.prototype.syncControl):
+        (StatusSupport):
+
+2017-02-23  Antoine Quint  <grao...@apple.com>
+
         [Modern Media Controls] Enforce a minimum layout height of 50pt for <audio>
         https://bugs.webkit.org/show_bug.cgi?id=168801
         <rdar://problem/30683453>

Modified: trunk/Source/WebCore/Modules/modern-media-controls/media/status-support.js (212939 => 212940)


--- trunk/Source/WebCore/Modules/modern-media-controls/media/status-support.js	2017-02-24 04:07:30 UTC (rev 212939)
+++ trunk/Source/WebCore/Modules/modern-media-controls/media/status-support.js	2017-02-24 05:27:54 UTC (rev 212940)
@@ -42,18 +42,18 @@
     {
         const media = this.mediaController.media;
         const isLiveBroadcast = media.duration === Number.POSITIVE_INFINITY;
-        const isPlayable = media.readyState > HTMLMediaElement.HAVE_METADATA && !media.error;
+        const canPlayThrough = media.readyState === HTMLMediaElement.HAVE_ENOUGH_DATA && !media.error;
 
         if (!!media.error)
             this.control.text = UIString("Error");
         else if (isLiveBroadcast && media.readyState >= HTMLMediaElement.HAVE_CURRENT_DATA)
             this.control.text = UIString("Live Broadcast");
-        else if (!isPlayable && media.networkState === HTMLMediaElement.NETWORK_LOADING)
+        else if (!canPlayThrough && media.networkState === HTMLMediaElement.NETWORK_LOADING)
             this.control.text = UIString("Loading");
         else
             this.control.text = "";
 
-        this.control.enabled = isLiveBroadcast || !isPlayable;
+        this.control.enabled = isLiveBroadcast || !canPlayThrough;
     }
 
 }
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to