Title: [185446] trunk/Source/WebCore
Revision
185446
Author
[email protected]
Date
2015-06-10 19:57:08 -0700 (Wed, 10 Jun 2015)

Log Message

Update presentation mode JS API to using 'picture-in-picture'
https://bugs.webkit.org/show_bug.cgi?id=145826
rdar://problem/2131153

Reviewed by Anders Carlsson.

Update presentation modes to use 'picture-in-picture' in lieu of 'optimized'.

* html/HTMLVideoElement.idl: Update to "picture-in-picture".
* html/HTMLVideoElement.cpp:
(WebCore::presentationModePictureInPicture): Rename static function returning string.
(WebCore::presentationModeOptimized): Deleted.
(WebCore::HTMLVideoElement::webkitSupportsPresentationMode): Use the new static function name.
(WebCore::HTMLVideoElement::webkitSetPresentationMode): Ditto.
(WebCore::HTMLVideoElement::webkitPresentationMode): Ditto.

* Modules/mediacontrols/mediaControlsiOS.js: Update to 'picture-in-picture'.
(ControllerIOS.prototype.configureInlineControls):
(ControllerIOS.prototype.isFullScreen):
(ControllerIOS.prototype.handleOptimizedFullscreenButtonClicked):
(ControllerIOS.prototype.handlePresentationModeChange):
(ControllerIOS.prototype.controlsAlwaysVisible):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (185445 => 185446)


--- trunk/Source/WebCore/ChangeLog	2015-06-11 02:34:03 UTC (rev 185445)
+++ trunk/Source/WebCore/ChangeLog	2015-06-11 02:57:08 UTC (rev 185446)
@@ -1,3 +1,28 @@
+2015-06-10  Jon Lee  <[email protected]>
+
+        Update presentation mode JS API to using 'picture-in-picture'
+        https://bugs.webkit.org/show_bug.cgi?id=145826
+        rdar://problem/2131153
+
+        Reviewed by Anders Carlsson.
+
+        Update presentation modes to use 'picture-in-picture' in lieu of 'optimized'.
+
+        * html/HTMLVideoElement.idl: Update to "picture-in-picture".
+        * html/HTMLVideoElement.cpp:
+        (WebCore::presentationModePictureInPicture): Rename static function returning string.
+        (WebCore::presentationModeOptimized): Deleted.
+        (WebCore::HTMLVideoElement::webkitSupportsPresentationMode): Use the new static function name.
+        (WebCore::HTMLVideoElement::webkitSetPresentationMode): Ditto.
+        (WebCore::HTMLVideoElement::webkitPresentationMode): Ditto.
+
+        * Modules/mediacontrols/mediaControlsiOS.js: Update to 'picture-in-picture'.
+        (ControllerIOS.prototype.configureInlineControls): 
+        (ControllerIOS.prototype.isFullScreen):
+        (ControllerIOS.prototype.handleOptimizedFullscreenButtonClicked):
+        (ControllerIOS.prototype.handlePresentationModeChange):
+        (ControllerIOS.prototype.controlsAlwaysVisible):
+
 2015-06-10  Boris Smus  <[email protected]>
 
         [Mobile Safari, WKWebView] increase DeviceOrientationEvent events emission frequency

Modified: trunk/Source/WebCore/Modules/mediacontrols/mediaControlsiOS.js (185445 => 185446)


--- trunk/Source/WebCore/Modules/mediacontrols/mediaControlsiOS.js	2015-06-11 02:34:03 UTC (rev 185445)
+++ trunk/Source/WebCore/Modules/mediacontrols/mediaControlsiOS.js	2015-06-11 02:57:08 UTC (rev 185446)
@@ -179,7 +179,7 @@
             // Hide the scrubber on audio until the user starts playing.
             this.controls.timelineBox.classList.add(this.ClassNames.hidden);
         } else {
-            if (Controller.gSimulateOptimizedFullscreenAvailable || ('webkitSupportsPresentationMode' in this.video && this.video.webkitSupportsPresentationMode('optimized')))
+            if (Controller.gSimulateOptimizedFullscreenAvailable || ('webkitSupportsPresentationMode' in this.video && this.video.webkitSupportsPresentationMode('picture-in-picture')))
                 this.controls.panel.appendChild(this.controls.optimizedFullscreenButton);
             this.controls.panel.appendChild(this.controls.fullscreenButton);
         }
@@ -392,7 +392,7 @@
 
     isFullScreen: function()
     {
-        return this.video.webkitDisplayingFullscreen && this.presentationMode() != 'optimized';
+        return this.video.webkitDisplayingFullscreen && this.presentationMode() != 'picture-in-picture';
     },
 
     handleFullscreenButtonClicked: function(event) {
@@ -432,10 +432,10 @@
         if (!('webkitSetPresentationMode' in this.video))
             return;
 
-        if (this.presentationMode() === 'optimized')
+        if (this.presentationMode() === 'picture-in-picture')
             this.video.webkitSetPresentationMode('inline');
         else
-            this.video.webkitSetPresentationMode('optimized');
+            this.video.webkitSetPresentationMode('picture-in-picture');
     },
 
     handleOptimizedFullscreenTouchStart: function() {
@@ -570,7 +570,7 @@
 
                 this.controls.optimizedFullscreenButton.classList.remove(this.ClassNames.returnFromOptimized);
                 break;
-            case 'optimized':
+            case 'picture-in-picture':
                 var backgroundImage = "url('" + this.host.mediaUIImageData("optimized-fullscreen-placeholder") + "')";
                 this.controls.inlinePlaybackPlaceholder.style.backgroundImage = backgroundImage;
                 this.controls.inlinePlaybackPlaceholder.setAttribute('aria-label', "video playback placeholder");
@@ -608,7 +608,7 @@
 
     controlsAlwaysVisible: function()
     {
-        if (this.presentationMode() === 'optimized')
+        if (this.presentationMode() === 'picture-in-picture')
             return true;
 
         return Controller.prototype.controlsAlwaysVisible.call(this);

Modified: trunk/Source/WebCore/html/HTMLVideoElement.cpp (185445 => 185446)


--- trunk/Source/WebCore/html/HTMLVideoElement.cpp	2015-06-11 02:34:03 UTC (rev 185445)
+++ trunk/Source/WebCore/html/HTMLVideoElement.cpp	2015-06-11 02:57:08 UTC (rev 185446)
@@ -351,10 +351,10 @@
     return fullscreen;
 }
 
-static const AtomicString& presentationModeOptimized()
+static const AtomicString& presentationModePictureInPicture()
 {
-    static NeverDestroyed<AtomicString> optimized("optimized", AtomicString::ConstructFromLiteral);
-    return optimized;
+    static NeverDestroyed<AtomicString> pictureInPicture("picture-in-picture", AtomicString::ConstructFromLiteral);
+    return pictureInPicture;
 }
 
 static const AtomicString& presentationModeInline()
@@ -368,7 +368,7 @@
     if (mode == presentationModeFullscreen())
         return mediaSession().fullscreenPermitted(*this) && supportsFullscreen();
 
-    if (mode == presentationModeOptimized())
+    if (mode == presentationModePictureInPicture())
         return wkIsOptimizedFullscreenSupported() && mediaSession().allowsAlternateFullscreen(*this) && supportsFullscreen();
 
     if (mode == presentationModeInline())
@@ -391,7 +391,7 @@
 
     if (mode == presentationModeFullscreen())
         enterFullscreen(VideoFullscreenModeStandard);
-    else if (mode == presentationModeOptimized())
+    else if (mode == presentationModePictureInPicture())
         enterFullscreen(VideoFullscreenModeOptimized);
 }
 
@@ -403,7 +403,7 @@
         return presentationModeFullscreen();
 
     if (mode & VideoFullscreenModeOptimized)
-        return presentationModeOptimized();
+        return presentationModePictureInPicture();
 
     if (mode == VideoFullscreenModeNone)
         return presentationModeInline();

Modified: trunk/Source/WebCore/html/HTMLVideoElement.idl (185445 => 185446)


--- trunk/Source/WebCore/html/HTMLVideoElement.idl	2015-06-11 02:34:03 UTC (rev 185445)
+++ trunk/Source/WebCore/html/HTMLVideoElement.idl	2015-06-11 02:57:08 UTC (rev 185446)
@@ -24,7 +24,7 @@
  */
 
 // FIXME: This should be Conditional=VIDEO_PRESENTATION_MODE.
-enum VideoPresentationMode { "fullscreen", "optimized", "inline" };
+enum VideoPresentationMode { "fullscreen", "picture-in-picture", "inline" };
 
 [
     Conditional=VIDEO,
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to