Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- diff --git c/WebCore/html/HTMLMediaElement.cpp i/WebCore/html/HTMLMediaElement.cpp
- index e9dc263..1b0f192 100644
- --- c/WebCore/html/HTMLMediaElement.cpp
- +++ i/WebCore/html/HTMLMediaElement.cpp
- @@ -1943,6 +1943,9 @@ void HTMLMediaElement::updatePlayState()
- setDisplayMode(Video);
- if (playerPaused) {
- + if (m_player->shouldForceFullscreenVideoPlayback() && !m_isFullscreen)
- + enterFullscreen();
- +
- // Set rate before calling play in case the rate was set before the media engine was setup.
- // The media engine should just stash the rate since it isn't already playing.
- m_player->setRate(m_playbackRate);
- @@ -2259,6 +2262,9 @@ void HTMLMediaElement::exitFullscreen()
- ASSERT(m_isFullscreen);
- m_isFullscreen = false;
- if (document() && document()->page()) {
- + if (m_player->shouldForceFullscreenVideoPlayback())
- + pauseInternal();
- +
- document()->page()->chrome()->client()->exitFullscreenForNode(this);
- scheduleEvent(eventNames().webkitendfullscreenEvent);
- if (renderer())
- diff --git c/WebCore/page/ChromeClient.h i/WebCore/page/ChromeClient.h
- index 7542615..66313d2 100644
- --- c/WebCore/page/ChromeClient.h
- +++ i/WebCore/page/ChromeClient.h
- @@ -244,6 +244,10 @@ namespace WebCore {
- virtual void enterFullScreenForElement(Element*) { }
- virtual void exitFullScreenForElement(Element*) { }
- #endif
- +
- +#if ENABLE(VIDEO)
- + virtual bool shouldForceFullScreenVideoPlayback() { return false; }
- +#endif
- #if ENABLE(TILED_BACKING_STORE)
- virtual IntRect visibleRectForTiledBackingStore() const { return IntRect(); }
- diff --git c/WebCore/platform/graphics/MediaPlayer.cpp i/WebCore/platform/graphics/MediaPlayer.cpp
- index 2a9e64e..6c2cdb7 100644
- --- c/WebCore/platform/graphics/MediaPlayer.cpp
- +++ i/WebCore/platform/graphics/MediaPlayer.cpp
- @@ -28,6 +28,8 @@
- #if ENABLE(VIDEO)
- #include "MediaPlayer.h"
- +#include "Chrome.h"
- +#include "ChromeClient.h"
- #include "ContentType.h"
- #include "Document.h"
- #include "Frame.h"
- @@ -397,6 +399,18 @@ bool MediaPlayer::supportsFullscreen() const
- return m_private->supportsFullscreen();
- }
- +bool MediaPlayer::shouldForceFullscreenVideoPlayback() const
- +{
- + Document* doc = document();
- + if (!doc || !doc->page())
- + return false;
- +
- + if (doc->page()->chrome()->client()->shouldForceFullScreenVideoPlayback())
- + return true;
- +
- + return false;
- +}
- +
- bool MediaPlayer::supportsSave() const
- {
- return m_private->supportsSave();
- @@ -417,12 +431,16 @@ bool MediaPlayer::hasAudio() const
- return m_private->hasAudio();
- }
- -bool MediaPlayer::inMediaDocument()
- +Document* MediaPlayer::document() const
- {
- Frame* frame = m_frameView ? m_frameView->frame() : 0;
- - Document* document = frame ? frame->document() : 0;
- -
- - return document && document->isMediaDocument();
- + return frame ? frame->document() : 0;
- +}
- +
- +bool MediaPlayer::inMediaDocument()
- +{
- + Document* doc = document();
- + return doc && doc->isMediaDocument();
- }
- PlatformMedia MediaPlayer::platformMedia() const
- diff --git c/WebCore/platform/graphics/MediaPlayer.h i/WebCore/platform/graphics/MediaPlayer.h
- index c2d0a00..48eca4e 100644
- --- c/WebCore/platform/graphics/MediaPlayer.h
- +++ i/WebCore/platform/graphics/MediaPlayer.h
- @@ -162,6 +162,7 @@ public:
- static bool isAvailable();
- bool supportsFullscreen() const;
- + bool shouldForceFullscreenVideoPlayback() const;
- bool supportsSave() const;
- PlatformMedia platformMedia() const;
- #if USE(ACCELERATED_COMPOSITING)
- @@ -279,6 +280,8 @@ private:
- static void initializeMediaEngines();
- + Document* document() const;
- +
- MediaPlayerClient* m_mediaPlayerClient;
- OwnPtr<MediaPlayerPrivateInterface*> m_private;
- void* m_currentMediaEngine;
Add Comment
Please, Sign In to add comment