<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&#64;apple.com" title="Antoine Quint &lt;graouts&#64;apple.com&gt;"> <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: &quot;loadedmetadata&quot;, &quot;error&quot;, &quot;webkitpresentationmodechanged&quot; and &quot;webkitcurrentplaybacktargetiswirelesschanged&quot;. 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 &amp;&amp; media.webkitSupportsPresentationMode(PiPMode) &amp;&amp; !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 &quot;loadedmetadata&quot; event fires:
    media instanceof HTMLVideoElement = true
    media.webkitSupportsPresentationMode(PiPMode) = false
    media.webkitCurrentPlaybackTargetIsWireless = false

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

So in all calls we eventually set &quot;enabled&quot; to false due to &quot;media.webkitSupportsPresentationMode(PiPMode)&quot; 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>