Changeset 203984 in webkit


Ignore:
Timestamp:
Aug 1, 2016 1:48:35 PM (8 years ago)
Author:
eric.carlson@apple.com
Message:

[iOS] A video element that does not pause after exiting from fullscreen should be allowed to continue playing inline
https://bugs.webkit.org/show_bug.cgi?id=160416
<rdar://problem/27409854>

Reviewed by Alex Christensen.

  • html/HTMLMediaElement.cpp:

(WebCore::HTMLMediaElement::exitFullscreen): If playback normally requires fullscreen but the
element was not paused when exiting from fullscreen, set the 'playsinline' attribute so we won't
force fullscreen if playback is paused and resumes, and set the 'controls' attribute so the
user can control playback.

Location:
trunk/Source/WebCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r203983 r203984  
     12016-08-01  Eric Carlson  <eric.carlson@apple.com>
     2
     3        [iOS] A video element that does not pause after exiting from fullscreen should be allowed to continue playing inline
     4        https://bugs.webkit.org/show_bug.cgi?id=160416
     5        <rdar://problem/27409854>
     6
     7        Reviewed by Alex Christensen.
     8
     9        * html/HTMLMediaElement.cpp:
     10        (WebCore::HTMLMediaElement::exitFullscreen): If playback normally requires fullscreen but the
     11        element was not paused when exiting from fullscreen, set the 'playsinline' attribute so we won't
     12        force fullscreen if playback is paused and resumes, and set the 'controls' attribute so the
     13        user can control playback.
     14
    1152016-08-01  Anders Carlsson  <andersca@apple.com>
    216
  • trunk/Source/WebCore/html/HTMLMediaElement.cpp

    r203982 r203984  
    54645464    if (hasMediaControls())
    54655465        mediaControls()->exitedFullscreen();
    5466     if (document().page() && is<HTMLVideoElement>(*this)) {
    5467         if (m_mediaSession->requiresFullscreenForVideoPlayback(*this) && (!document().settings() || !document().settings()->allowsInlineMediaPlaybackAfterFullscreen() || isVideoTooSmallForInlinePlayback()))
     5466
     5467    if (!document().page() || !is<HTMLVideoElement>(*this))
     5468        return;
     5469
     5470    if (!paused() && m_mediaSession->requiresFullscreenForVideoPlayback(*this)) {
     5471        if (!document().settings() || !document().settings()->allowsInlineMediaPlaybackAfterFullscreen() || isVideoTooSmallForInlinePlayback())
    54685472            pauseInternal();
     5473        else {
     5474            // Allow inline playback, but set 'playsinline' so pausing and starting again (e.g. when scrubbing) won't go back to fullscreen.
     5475            // Also set the controls attribute so the user will be able to control playback.
     5476            setBooleanAttribute(HTMLNames::playsinlineAttr, true);
     5477            setControls(true);
     5478        }
     5479    }
    54695480
    54705481#if PLATFORM(MAC) && ENABLE(VIDEO_PRESENTATION_MODE)
    5471         if (document().activeDOMObjectsAreSuspended() || document().activeDOMObjectsAreStopped())
    5472             document().page()->chrome().client().exitVideoFullscreenToModeWithoutAnimation(downcast<HTMLVideoElement>(*this), VideoFullscreenModeNone);
    5473         else
    5474 #endif
    5475         if (document().page()->chrome().client().supportsVideoFullscreen(oldVideoFullscreenMode)) {
    5476             document().page()->chrome().client().exitVideoFullscreenForVideoElement(downcast<HTMLVideoElement>(*this));
    5477             scheduleEvent(eventNames().webkitendfullscreenEvent);
    5478         }
     5482    if (document().activeDOMObjectsAreSuspended() || document().activeDOMObjectsAreStopped())
     5483        document().page()->chrome().client().exitVideoFullscreenToModeWithoutAnimation(downcast<HTMLVideoElement>(*this), VideoFullscreenModeNone);
     5484    else
     5485#endif
     5486    if (document().page()->chrome().client().supportsVideoFullscreen(oldVideoFullscreenMode)) {
     5487        document().page()->chrome().client().exitVideoFullscreenForVideoElement(downcast<HTMLVideoElement>(*this));
     5488        scheduleEvent(eventNames().webkitendfullscreenEvent);
    54795489    }
    54805490}
Note: See TracChangeset for help on using the changeset viewer.