| Index: Source/core/html/HTMLMediaElement.cpp
|
| diff --git a/Source/core/html/HTMLMediaElement.cpp b/Source/core/html/HTMLMediaElement.cpp
|
| index 4d11d74ae9cdb586dc694f0494e14add9c3e61f5..77bb47a7feb6a1f7602fbab1ca1f65889d033263 100644
|
| --- a/Source/core/html/HTMLMediaElement.cpp
|
| +++ b/Source/core/html/HTMLMediaElement.cpp
|
| @@ -65,6 +65,7 @@
|
| #include "core/layout/compositing/DeprecatedPaintLayerCompositor.h"
|
| #include "core/loader/FrameLoader.h"
|
| #include "core/loader/FrameLoaderClient.h"
|
| +#include "core/page/ChromeClient.h"
|
| #include "platform/ContentType.h"
|
| #include "platform/Logging.h"
|
| #include "platform/MIMETypeFromURL.h"
|
| @@ -363,6 +364,7 @@ HTMLMediaElement::HTMLMediaElement(const QualifiedName& tagName, Document& docum
|
| , m_isFinalizing(false)
|
| , m_initialPlayWithoutUserGestures(false)
|
| , m_autoplayMediaCounted(false)
|
| + , m_inOverlayFullscreenVideo(false)
|
| , m_audioTracks(AudioTrackList::create(*this))
|
| , m_videoTracks(VideoTrackList::create(*this))
|
| , m_textTracks(nullptr)
|
| @@ -1051,8 +1053,10 @@ void HTMLMediaElement::startPlayerLoad()
|
|
|
| m_webMediaPlayer->load(loadType(), kurl, corsMode());
|
|
|
| - if (isFullscreen())
|
| - m_webMediaPlayer->enterFullscreen();
|
| + if (isFullscreen()) {
|
| + // This handles any transition to or from fullscreen overlay mode.
|
| + document().frame()->chromeClient().enterFullScreenForElement(this);
|
| + }
|
| }
|
|
|
| void HTMLMediaElement::setPlayerPreload()
|
| @@ -3201,7 +3205,8 @@ void HTMLMediaElement::didBecomeFullscreenElement()
|
| {
|
| if (mediaControls())
|
| mediaControls()->enteredFullscreen();
|
| - if (RuntimeEnabledFeatures::overlayFullscreenVideoEnabled() && isHTMLVideoElement())
|
| + // Cache this in case the player is destroyed before leaving fullscreen.
|
| + if ((m_inOverlayFullscreenVideo = supportsOverlayFullscreenVideo()))
|
| document().layoutView()->compositor()->setNeedsCompositingUpdate(CompositingUpdateRebuildTree);
|
| }
|
|
|
| @@ -3209,8 +3214,9 @@ void HTMLMediaElement::willStopBeingFullscreenElement()
|
| {
|
| if (mediaControls())
|
| mediaControls()->exitedFullscreen();
|
| - if (RuntimeEnabledFeatures::overlayFullscreenVideoEnabled() && isHTMLVideoElement())
|
| + if (m_inOverlayFullscreenVideo)
|
| document().layoutView()->compositor()->setNeedsCompositingUpdate(CompositingUpdateRebuildTree);
|
| + m_inOverlayFullscreenVideo = false;
|
| }
|
|
|
| WebLayer* HTMLMediaElement::platformLayer() const
|
|
|