[Webkit-unassigned] [Bug 167794] [Modern Media Controls] PiP button is not visible with a live broadcast video

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Fri Feb 3 09:11:57 PST 2017


https://bugs.webkit.org/show_bug.cgi?id=167794

--- Comment #2 from Antoine Quint <graouts at apple.com> ---
The PiPSupport class (Source/WebCore/Modules/modern-media-controls/media/pip-support.js) listens to several events to update the enabled state of the PiP control: "loadedmetadata", "error", "webkitpresentationmodechanged" and "webkitcurrentplaybacktargetiswirelesschanged". As those events are dispatched, the following method is called:

    syncControl()
    {
        const media = this.mediaController.media;
        if (media.webkitSupportsPresentationMode)
            this.control.enabled = media instanceof HTMLVideoElement && media.webkitSupportsPresentationMode(PiPMode) && !media.webkitCurrentPlaybackTargetIsWireless;
        else
            this.control.enabled = false;
    }

As the testcase loads, we get three calls:

1. one from the constructor (this happens to set some initial state prior to any event firing):
    media instanceof HTMLVideoElement = true
    media.webkitSupportsPresentationMode(PiPMode) = false
    media.webkitCurrentPlaybackTargetIsWireless = false

2. the "loadedmetadata" event fires:
    media instanceof HTMLVideoElement = true
    media.webkitSupportsPresentationMode(PiPMode) = false
    media.webkitCurrentPlaybackTargetIsWireless = false

3. the "webkitcurrentplaybacktargetiswirelesschanged" event fires:
    media instanceof HTMLVideoElement = true
    media.webkitSupportsPresentationMode(PiPMode) = false
    media.webkitCurrentPlaybackTargetIsWireless = false

So in all calls we eventually set "enabled" to false due to "media.webkitSupportsPresentationMode(PiPMode)" being false. Is there some other event we should be using that would determine that a live broadcast video has PiP enabled?

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.webkit.org/pipermail/webkit-unassigned/attachments/20170203/f79e2c1e/attachment-0001.html>


More information about the webkit-unassigned mailing list