Skip to content
  • eric.carlson@apple.com's avatar
    Allow MediaSessionManager to restrict inline <video> playback · 43768160
    eric.carlson@apple.com authored
    https://bugs.webkit.org/show_bug.cgi?id=127113
    
    Reviewed by Jer Noble.
    
    Source/WebCore: 
    
    Test: media/video-fullscreeen-only-playback.html
    
    * html/HTMLMediaElement.cpp:
    (WebCore::HTMLMediaElement::updatePlayState): Drive-by change to not tell the media session that
        playback is starting if the media player is already playing. Enter fullscreen if the media
        session says it is required.
    
    * html/HTMLMediaSession.cpp:
    (WebCore::HTMLMediaSession::clientWillBeginPlayback): Make it const.
    (WebCore::HTMLMediaSession::requiresFullscreenForVideoPlayback): New, see if the specified
        media element must be played in fullscreen based on the media session settings, document
        settings, and attributes.
    * html/HTMLMediaSession.h:
    
    * platform/audio/MediaSession.h: pauseSession shouldn't be virtual.
    
    * platform/audio/MediaSessionManager.cpp:
    (WebCore::MediaSessionManager::sessionWillBeginPlayback): Return immediately if ConcurrentPlaybackNotPermitted
        is not set.
    (WebCore::MediaSessionManager::sessionRestrictsInlineVideoPlayback): New.
    * platform/audio/MediaSessionManager.h:
    
    * platform/audio/ios/MediaSessionManagerIOS.mm:
    (WebCore::MediaSessionManageriOS::MediaSessionManageriOS): Set InlineVideoPlaybackRestricted if
        running on an iPhone or iPod class device.
    
    * testing/Internals.cpp:
    (WebCore::Internals::setMediaSessionRestrictions): Support InlineVideoPlaybackRestricted.
    
    LayoutTests: 
    
    * media/video-fullscreeen-only-playback-expected.txt: Added.
    * media/video-fullscreeen-only-playback.html: Added.
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@162145 268f45cc-cd09-0410-ab3c-d52691b4dbfc
    43768160