<html>
<head>
<base href="https://bugs.webkit.org/" />
</head>
<body>
<p>
<div>
<b><a class="bz_bug_link
bz_status_NEW "
title="NEW - [Modern Media Controls] PiP button is not visible with a live broadcast video"
href="https://bugs.webkit.org/show_bug.cgi?id=167794#c2">Comment # 2</a>
on <a class="bz_bug_link
bz_status_NEW "
title="NEW - [Modern Media Controls] PiP button is not visible with a live broadcast video"
href="https://bugs.webkit.org/show_bug.cgi?id=167794">bug 167794</a>
from <span class="vcard"><a class="email" href="mailto:graouts@apple.com" title="Antoine Quint <graouts@apple.com>"> <span class="fn">Antoine Quint</span></a>
</span></b>
<pre>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?</pre>
</div>
</p>
<hr>
<span>You are receiving this mail because:</span>
<ul>
<li>You are the assignee for the bug.</li>
</ul>
</body>
</html>