[MediaControls][iOS] Enable JavaScript Media Controls on iOS.
[WebKit-https.git] / Source / WebCore / Modules / mediacontrols / mediaControlsApple.js
index bab12f7..f9eec68 100644 (file)
@@ -57,7 +57,7 @@ Controller.prototype = {
         volumechange: 'handleVolumeChange',
         webkitfullscreenchange: 'handleFullscreenChange',
     },
-    HideContrtolsDelay: 4 * 1000,
+    HideControlsDelay: 4 * 1000,
     RewindAmount: 30,
     MaximumSeekRate: 8,
     SeekDelay: 1500,
@@ -547,7 +547,7 @@ Controller.prototype = {
         this.showControls();
         if (this.hideTimer)
             clearTimeout(this.hideTimer);
-        this.hideTimer = setTimeout(this.hideControls.bind(this), this.HideContrtolsDelay);
+        this.hideTimer = setTimeout(this.hideControls.bind(this), this.HideControlsDelay);
 
         if (!this.isDragging)
             return;
@@ -559,7 +559,7 @@ Controller.prototype = {
 
     handleWrapperMouseOut: function(event)
     {
-        this.controls.panel.classList.remove(this.ClassNames.show);
+        this.hideControls();
         if (this.hideTimer)
             clearTimeout(this.hideTimer);
     },
@@ -836,10 +836,10 @@ Controller.prototype = {
             this.controls.playButton.classList.remove(this.ClassNames.paused);
             this.controls.playButton.setAttribute('aria-label', this.UIString('Pause'));
 
-            this.controls.panel.classList.remove(this.ClassNames.show);
+            this.hideControls();
             if (this.hideTimer)
                 clearTimeout(this.hideTimer);
-            this.hideTimer = setTimeout(this.hideControls.bind(this), this.HideContrtolsDelay);
+            this.hideTimer = setTimeout(this.hideControls.bind(this), this.HideControlsDelay);
         }
     },
 
@@ -854,6 +854,11 @@ Controller.prototype = {
         this.controls.panel.classList.remove(this.ClassNames.show);
     },
 
+    controlsAreHidden: function()
+    {
+        return !this.controls.panel.classList.contains(this.ClassNames.show) || this.controls.panel.classList.contains(this.ClassNames.hidden);
+    },
+
     removeControls: function()
     {
         if (this.controls.panel.parentNode)