<html>
    <head>
      <base href="https://bugs.webkit.org/" />
    </head>
    <body>
      <p>
        <div>
            <b><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - Media Session: push paused state to the media session focus manager instead of polling"
   href="https://bugs.webkit.org/show_bug.cgi?id=147633#c9">Comment # 9</a>
              on <a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - Media Session: push paused state to the media session focus manager instead of polling"
   href="https://bugs.webkit.org/show_bug.cgi?id=147633">bug 147633</a>
              from <span class="vcard"><a class="email" href="mailto:mrajca&#64;apple.com" title="Matt Rajca &lt;mrajca&#64;apple.com&gt;"> <span class="fn">Matt Rajca</span></a>
</span></b>
        <pre>(In reply to <a href="show_bug.cgi?id=147633#c8">comment #8</a>)
<span class="quote">&gt; Comment on <span class=""><a href="attachment.cgi?id=258291&amp;action=diff" name="attach_258291" title="Patch">attachment 258291</a> <a href="attachment.cgi?id=258291&amp;action=edit" title="Patch">[details]</a></span>
&gt; Patch
&gt; 
&gt; View in context:
&gt; <a href="https://bugs.webkit.org/attachment.cgi?id=258291&amp;action=review">https://bugs.webkit.org/attachment.cgi?id=258291&amp;action=review</a>
&gt; 
&gt; &gt;&gt;&gt; Source/WebCore/dom/Document.h:1263
&gt; &gt;&gt;&gt; +    WEBCORE_EXPORT void updateIsPlayingMedia(uint64_t);
&gt; &gt;&gt; 
&gt; &gt;&gt; How does this work if more than one media element is playing?
&gt; &gt; 
&gt; &gt; Every time any media element changes its 'playing' state, that information propagates to the UI process. The UI process keeps track of the currently focused media element belonging to a &quot;Content&quot; Media Session (there can only be one at a time). If the element IDs match, we can cache the 'playing' state as the focused media element's playing state.
&gt; 
&gt; Please make a typedef for this uint64_t (MediaElementID or whatever), and
&gt; convert the current code to use it. You can do this in a separate patch.</span >

Filed <a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - Media Session: add MediaElementID type for media element IDs"
   href="show_bug.cgi?id=147709">Bug 147709</a>.

<span class="quote">&gt; 
&gt; Give this a default argument, so you don't have to specify
&gt; HTMLMediaElementInvalidID everywhere.</span >

Done.

<span class="quote">&gt; 
&gt; &gt; Source/WebCore/html/HTMLMediaElement.cpp:3177
&gt; &gt; +#if ENABLE(MEDIA_SESSION)
&gt; &gt; +        document().updateIsPlayingMedia(m_elementID);
&gt; &gt; +#else
&gt; &gt; +        document().updateIsPlayingMedia(0);
&gt; &gt; +#endif
&gt; 
&gt; This #ifdef is confusing. Why can't you always pass m_elementID?</span >

Element IDs are only assigned under the Media Session feature flag. With the default argument added, though, the confusing 0 argument is now gone.

<span class="quote">&gt; 
&gt; &gt; Source/WebCore/html/HTMLMediaElement.cpp:4545
&gt; &gt; +#if ENABLE(MEDIA_SESSION)
&gt; &gt; +    document().updateIsPlayingMedia(m_elementID);
&gt; &gt; +#else
&gt; &gt; +    document().updateIsPlayingMedia(0);
&gt; &gt; +#endif
&gt; 
&gt; Ditto.
&gt; 
&gt; &gt; Source/WebCore/html/HTMLMediaElement.cpp:4810
&gt; &gt; +#if ENABLE(MEDIA_SESSION)
&gt; &gt; +    document().updateIsPlayingMedia(m_elementID);
&gt; &gt; +#else
&gt; &gt; +    document().updateIsPlayingMedia(0);
&gt; &gt; +#endif
&gt; 
&gt; Ditto.</span ></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>