Changeset 133606 in webkit
- Timestamp:
- Nov 6, 2012, 7:27:54 AM (13 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r133598 r133606 1 2012-11-06 Max Feil <mfeil@rim.com> 2 3 [BlackBerry] Automatically go fullscreen on video play 4 https://bugs.webkit.org/show_bug.cgi?id=101100 5 6 Reviewed by Eric Carlson. 7 8 Test that fullscreen is entered automatically when play is 9 pressed (PR131774). This test applies to handheld (small screen) 10 devices only, not tablets. The html code for this test was based 11 on video-controls-fullscreen-volume.html and modified. 12 13 * platform/blackberry/media/video-automatic-fullscreen-expected.txt: Added. 14 * platform/blackberry/media/video-automatic-fullscreen.html: Added. 15 1 16 2012-11-06 Vsevolod Vlasov <vsevik@chromium.org> 2 17 -
trunk/Source/WebCore/ChangeLog
r133602 r133606 1 2012-11-06 Max Feil <mfeil@rim.com> 2 3 [BlackBerry] Automatically go fullscreen on video play 4 https://bugs.webkit.org/show_bug.cgi?id=101100 5 6 Reviewed by Eric Carlson. 7 8 There is a requirement to have HTML5 video automatically enter 9 fullscreen when a video starts playing (PR131774). This change 10 implements this feature, with restrictions. The main restriction 11 is adherence to WebKit's philosophy of only entering fullscreen 12 due to a user gesture. This is important in order to avoid 13 pop-up advertisements and other unwanted fullscreen content. 14 One consequence of this is that video elements with the autoplay 15 attribute will not automatically enter fullscreen. 16 17 Other caveats: 18 - This feature applies only to "small screen" devices where 19 automatically going fullscreen makes more sense. 20 - Fullscreen will only be entered automatically when the 21 video is played from the beginning (current time is zero). 22 It is assumed that if the user is resuming play from a paused 23 state and is not in fullscreen mode, then they exited fullscreen 24 mode intentionally. 25 26 Test: platform/blackberry/media/video-automatic-fullscreen.html 27 28 * html/HTMLMediaElement.cpp: 29 (WebCore::HTMLMediaElement::mediaPlayerEnterFullscreen): 30 (WebCore): 31 (WebCore::HTMLMediaElement::mediaPlayerIsFullscreen): 32 (WebCore::HTMLMediaElement::mediaPlayerIsFullscreenPermitted): 33 * html/HTMLMediaElement.h: 34 (HTMLMediaElement): 35 * platform/graphics/MediaPlayer.h: 36 (WebCore::MediaPlayerClient::mediaPlayerEnterFullscreen): 37 (WebCore::MediaPlayerClient::mediaPlayerIsFullscreen): 38 (WebCore::MediaPlayerClient::mediaPlayerIsFullscreenPermitted): 39 * platform/graphics/blackberry/MediaPlayerPrivateBlackBerry.cpp: 40 (WebCore::MediaPlayerPrivate::play): 41 (WebCore::MediaPlayerPrivate::waitMetadataTimerFired): 42 (WebCore::MediaPlayerPrivate::conditionallyGoFullscreenAfterPlay): 43 (WebCore): 44 * platform/graphics/blackberry/MediaPlayerPrivateBlackBerry.h: 45 (MediaPlayerPrivate): 46 1 47 2012-11-06 Grzegorz Czajkowski <g.czajkowski@samsung.com> 2 48 -
trunk/Source/WebCore/html/HTMLMediaElement.cpp
r133262 r133606 4524 4524 } 4525 4525 4526 void HTMLMediaElement::mediaPlayerEnterFullscreen() 4527 { 4528 enterFullscreen(); 4529 } 4530 4526 4531 void HTMLMediaElement::mediaPlayerExitFullscreen() 4527 4532 { 4528 4533 exitFullscreen(); 4534 } 4535 4536 bool HTMLMediaElement::mediaPlayerIsFullscreen() const 4537 { 4538 return isFullscreen(); 4539 } 4540 4541 bool HTMLMediaElement::mediaPlayerIsFullscreenPermitted() const 4542 { 4543 return !userGestureRequiredForFullscreen() || ScriptController::processingUserGesture(); 4529 4544 } 4530 4545 -
trunk/Source/WebCore/html/HTMLMediaElement.h
r133262 r133606 429 429 virtual String mediaPlayerDocumentHost() const OVERRIDE; 430 430 431 virtual void mediaPlayerEnterFullscreen() OVERRIDE; 431 432 virtual void mediaPlayerExitFullscreen() OVERRIDE; 433 virtual bool mediaPlayerIsFullscreen() const OVERRIDE; 434 virtual bool mediaPlayerIsFullscreenPermitted() const OVERRIDE; 432 435 virtual bool mediaPlayerIsVideo() const OVERRIDE; 433 436 virtual LayoutRect mediaPlayerContentBoxRect() const OVERRIDE; -
trunk/Source/WebCore/platform/graphics/MediaPlayer.h
r131502 r133606 194 194 virtual String mediaPlayerUserAgent() const { return String(); } 195 195 virtual CORSMode mediaPlayerCORSMode() const { return Unspecified; } 196 virtual void mediaPlayerEnterFullscreen() { } 196 197 virtual void mediaPlayerExitFullscreen() { } 198 virtual bool mediaPlayerIsFullscreen() const { return false; } 199 virtual bool mediaPlayerIsFullscreenPermitted() const { return false; } 197 200 virtual bool mediaPlayerIsVideo() const { return false; } 198 201 virtual LayoutRect mediaPlayerContentBoxRect() const { return LayoutRect(); } -
trunk/Source/WebCore/platform/graphics/blackberry/MediaPlayerPrivateBlackBerry.cpp
r131316 r133606 40 40 #include "WebPageClient.h" 41 41 42 #include <BlackBerryPlatformDeviceInfo.h> 42 43 #include <BlackBerryPlatformSettings.h> 43 44 #include <FrameLoaderClientBlackBerry.h> … … 188 189 void MediaPlayerPrivate::play() 189 190 { 190 if (m_platformPlayer) 191 if (m_platformPlayer) { 191 192 m_platformPlayer->play(); 193 if (m_platformPlayer->isMetadataReady()) 194 conditionallyGoFullscreenAfterPlay(); 195 } 192 196 } 193 197 … … 664 668 if (m_platformPlayer->isMetadataReady()) { 665 669 m_platformPlayer->playWithMetadataReady(); 670 conditionallyGoFullscreenAfterPlay(); 666 671 m_waitMetadataPopDialogCounter = 0; 667 672 return; … … 680 685 onPauseNotified(); 681 686 else { 682 if (m_platformPlayer->isMetadataReady()) 687 if (m_platformPlayer->isMetadataReady()) { 683 688 m_platformPlayer->playWithMetadataReady(); 684 else 689 conditionallyGoFullscreenAfterPlay(); 690 } else 685 691 m_waitMetadataTimer.startOneShot(checkMetadataReadyInterval); 686 692 } … … 964 970 #endif 965 971 972 void MediaPlayerPrivate::conditionallyGoFullscreenAfterPlay() 973 { 974 BlackBerry::Platform::DeviceInfo* info = BlackBerry::Platform::DeviceInfo::instance(); 975 if (hasVideo() && m_webCorePlayer->mediaPlayerClient()->mediaPlayerIsFullscreenPermitted() && info->isMobile()) { 976 // This is a mobile device (small screen), not a tablet, so we 977 // enter fullscreen video on user-initiated plays. 978 bool nothingIsFullscreen = !m_webCorePlayer->mediaPlayerClient()->mediaPlayerIsFullscreen(); 979 #if ENABLE(FULLSCREEN_API) 980 if (m_webCorePlayer->mediaPlayerClient()->mediaPlayerOwningDocument()->webkitIsFullScreen()) 981 nothingIsFullscreen = false; 982 #endif 983 if (nothingIsFullscreen && currentTime() == 0.0f) { 984 // Only enter fullscreen when playing from the beginning. Doing 985 // so on every play is sure to annoy the user who does not want 986 // to watch the video fullscreen. Note that the following call 987 // will fail if we are not here due to a user gesture, as per the 988 // check in Document::requestFullScreenForElement() to prevent 989 // popups. 990 m_webCorePlayer->mediaPlayerClient()->mediaPlayerEnterFullscreen(); 991 } 992 } 993 } 994 966 995 } // namespace WebCore 967 996 -
trunk/Source/WebCore/platform/graphics/blackberry/MediaPlayerPrivateBlackBerry.h
r131316 r133606 171 171 #endif 172 172 173 void conditionallyGoFullscreenAfterPlay(); 173 174 void userDrivenSeekTimerFired(Timer<MediaPlayerPrivate>*); 174 175 Timer<MediaPlayerPrivate> m_userDrivenSeekTimer;
Note:
See TracChangeset
for help on using the changeset viewer.