Changeset 252365 in webkit


Ignore:
Timestamp:
Nov 12, 2019 7:39:48 AM (4 years ago)
Author:
commit-queue@webkit.org
Message:

Picture-in-Picture events are not fired if we switch the Picture-in-Picture mode through modern media controls
https://bugs.webkit.org/show_bug.cgi?id=203933

Patch by Peng Liu <Peng Liu> on 2019-11-12
Reviewed by Eric Carlson.

When the Picture-in-Picture API is not available, we need to call webkitSetPresentationMode()
of the video element to implement the picture-in-picture feature.

No new tests, covered by test: media/modern-media-controls/pip-support/pip-support-click.html

  • Modules/modern-media-controls/media/pip-support.js:

(PiPSupport.prototype.buttonWasPressed):

Location:
trunk/Source/WebCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r252353 r252365  
     12019-11-12  Peng Liu  <peng.liu6@apple.com>
     2
     3        Picture-in-Picture events are not fired if we switch the Picture-in-Picture mode through modern media controls
     4        https://bugs.webkit.org/show_bug.cgi?id=203933
     5
     6        Reviewed by Eric Carlson.
     7
     8        When the Picture-in-Picture API is not available, we need to call webkitSetPresentationMode()
     9        of the video element to implement the picture-in-picture feature.
     10
     11        No new tests, covered by test: media/modern-media-controls/pip-support/pip-support-click.html
     12
     13        * Modules/modern-media-controls/media/pip-support.js:
     14        (PiPSupport.prototype.buttonWasPressed):
     15
    1162019-11-11  Per Arne Vollan  <pvollan@apple.com>
    217
  • trunk/Source/WebCore/Modules/modern-media-controls/media/pip-support.js

    r252240 r252365  
    5050    {
    5151        const media = this.mediaController.media;
     52        if (!document.pictureInPictureEnabled) {
     53            media.webkitSetPresentationMode(media.webkitPresentationMode === PiPMode ? InlineMode : PiPMode);
     54            return;
     55        }
     56
    5257        if (!document.pictureInPictureElement)
    5358            media.requestPictureInPicture();
Note: See TracChangeset for help on using the changeset viewer.