Skip to content
Permalink
Browse files
2010-12-16 Yi Shen <yi.4.shen@nokia.com>, Tor Arne Vestbo <tor.arne.v…
…estbo@nokia.com>

        Reviewed by Eric Carlson.

        Provide an interface to require using fullscreen mediaplayer
        https://bugs.webkit.org/show_bug.cgi?id=51133

        Add ChromeClient::requiresFullscreenForVideoPlayback to require webkit
        to launch fullscreen video player for playing the html5 video. The
        idea is that a browser vendor can specify this behavior through the
        platform plugin or something else by using this interface.

        No new tests because no client implements requiresFullscreenForVideoPlayback yet.

        * html/HTMLMediaElement.cpp:
        (WebCore::HTMLMediaElement::updatePlayState):
        (WebCore::HTMLMediaElement::exitFullscreen):
        * page/Chrome.cpp:
        (WebCore::Chrome::requiresFullscreenForVideoPlayback):
        * page/Chrome.h:
        * page/ChromeClient.h:
        (WebCore::ChromeClient::requiresFullscreenForVideoPlayback):

Canonical link: https://commits.webkit.org/64575@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@74228 268f45cc-cd09-0410-ab3c-d52691b4dbfc
  • Loading branch information
webkit-commit-queue committed Dec 17, 2010
1 parent 583fd2e commit c4eac8ecf6be29a2608df1f27742607bb2c7239a
Showing 5 changed files with 36 additions and 0 deletions.
@@ -1,3 +1,26 @@
2010-12-16 Yi Shen <yi.4.shen@nokia.com>, Tor Arne Vestbo <tor.arne.vestbo@nokia.com>

Reviewed by Eric Carlson.

Provide an interface to require using fullscreen mediaplayer
https://bugs.webkit.org/show_bug.cgi?id=51133

Add ChromeClient::requiresFullscreenForVideoPlayback to require webkit
to launch fullscreen video player for playing the html5 video. The
idea is that a browser vendor can specify this behavior through the
platform plugin or something else by using this interface.

No new tests because no client implements requiresFullscreenForVideoPlayback yet.

* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::updatePlayState):
(WebCore::HTMLMediaElement::exitFullscreen):
* page/Chrome.cpp:
(WebCore::Chrome::requiresFullscreenForVideoPlayback):
* page/Chrome.h:
* page/ChromeClient.h:
(WebCore::ChromeClient::requiresFullscreenForVideoPlayback):

2010-12-16 Steve Block <steveblock@google.com>

Reviewed by Steve Block.
@@ -2109,6 +2109,9 @@ void HTMLMediaElement::updatePlayState()
invalidateCachedTime();

if (playerPaused) {
if (document() && document()->page() && document()->page()->chrome()->requiresFullscreenForVideoPlayback() && !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);
@@ -2424,6 +2427,8 @@ void HTMLMediaElement::exitFullscreen()
ASSERT(m_isFullscreen);
m_isFullscreen = false;
if (document() && document()->page()) {
if (document()->page()->chrome()->requiresFullscreenForVideoPlayback())
pauseInternal();
document()->page()->chrome()->client()->exitFullscreenForNode(this);
scheduleEvent(eventNames().webkitendfullscreenEvent);
}
@@ -521,4 +521,9 @@ void Chrome::showContextMenu()
}
#endif

bool Chrome::requiresFullscreenForVideoPlayback()
{
return m_client->requiresFullscreenForVideoPlayback();
}

} // namespace WebCore
@@ -149,6 +149,8 @@ namespace WebCore {

void dispatchViewportDataDidChange(const ViewportArguments&) const;

bool requiresFullscreenForVideoPlayback();

#if PLATFORM(MAC)
void focusNSView(NSView*);
#endif
@@ -256,6 +256,7 @@ namespace WebCore {
virtual bool supportsFullscreenForNode(const Node*) { return false; }
virtual void enterFullscreenForNode(Node*) { }
virtual void exitFullscreenForNode(Node*) { }
virtual bool requiresFullscreenForVideoPlayback() { return false; }

#if ENABLE(FULLSCREEN_API)
virtual bool supportsFullScreenForElement(const Element*) { return false; }

0 comments on commit c4eac8e

Please sign in to comment.