Pause playback on exit fullscreen when inline playback not allowed.
authorjeremyj@apple.com <jeremyj@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 2 May 2014 13:52:01 +0000 (13:52 +0000)
committerjeremyj@apple.com <jeremyj@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 2 May 2014 13:52:01 +0000 (13:52 +0000)
https://bugs.webkit.org/show_bug.cgi?id=132450

Reviewed by Jer Noble.

Use correct method of determining if inline playback is allowed.

* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::parseAttribute):
Use m_mediaSession->requiresFullscreenForVideoPlayback to detect if inline playback is allowed.

* platform/ios/WebVideoFullscreenModelMediaElement.mm:
(WebVideoFullscreenModelMediaElement::requestExitFullscreen):
Prevent duplicate exit requests.

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

Source/WebCore/ChangeLog
Source/WebCore/html/HTMLMediaElement.cpp
Source/WebCore/platform/ios/WebVideoFullscreenModelMediaElement.mm

index 3a245de..a4446c5 100644 (file)
@@ -1,3 +1,20 @@
+2014-05-02  Jeremy Jones  <jeremyj@apple.com>
+
+        Pause playback on exit fullscreen when inline playback not allowed.
+        https://bugs.webkit.org/show_bug.cgi?id=132450
+
+        Reviewed by Jer Noble.
+
+        Use correct method of determining if inline playback is allowed.
+
+        * html/HTMLMediaElement.cpp:
+        (WebCore::HTMLMediaElement::parseAttribute):
+        Use m_mediaSession->requiresFullscreenForVideoPlayback to detect if inline playback is allowed.
+
+        * platform/ios/WebVideoFullscreenModelMediaElement.mm:
+        (WebVideoFullscreenModelMediaElement::requestExitFullscreen):
+        Prevent duplicate exit requests.
+
 2014-05-02  Ion Rosca  <rosca@adobe.com>
 
         [CSS Blending] Remove support for non-separable blend modes from background-blend-mode
 2014-05-02  Ion Rosca  <rosca@adobe.com>
 
         [CSS Blending] Remove support for non-separable blend modes from background-blend-mode
index e6f36cb..8bc3962 100644 (file)
@@ -4839,7 +4839,7 @@ void HTMLMediaElement::exitFullscreen()
     if (hasMediaControls())
         mediaControls()->exitedFullscreen();
     if (document().page()) {
     if (hasMediaControls())
         mediaControls()->exitedFullscreen();
     if (document().page()) {
-        if (document().page()->chrome().requiresFullscreenForVideoPlayback())
+        if (m_mediaSession->requiresFullscreenForVideoPlayback(*this))
             pauseInternal();
 
         if (document().page()->chrome().client().supportsFullscreenForNode(this)) {
             pauseInternal();
 
         if (document().page()->chrome().client().supportsFullscreenForNode(this)) {
index 126039c..94b695f 100644 (file)
@@ -176,7 +176,8 @@ void WebVideoFullscreenModelMediaElement::requestExitFullscreen()
 {
     __block RefPtr<WebVideoFullscreenModelMediaElement> protect(this);
     WebThreadRun(^{
 {
     __block RefPtr<WebVideoFullscreenModelMediaElement> protect(this);
     WebThreadRun(^{
-        m_mediaElement->exitFullscreen();
+        if (m_mediaElement->isFullscreen())
+            m_mediaElement->exitFullscreen();
         protect.clear();
     });
 }
         protect.clear();
     });
 }