<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@apple.com" title="Matt Rajca <mrajca@apple.com>"> <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">> Comment on <span class=""><a href="attachment.cgi?id=258291&action=diff" name="attach_258291" title="Patch">attachment 258291</a> <a href="attachment.cgi?id=258291&action=edit" title="Patch">[details]</a></span>
> Patch
>
> View in context:
> <a href="https://bugs.webkit.org/attachment.cgi?id=258291&action=review">https://bugs.webkit.org/attachment.cgi?id=258291&action=review</a>
>
> >>> Source/WebCore/dom/Document.h:1263
> >>> + WEBCORE_EXPORT void updateIsPlayingMedia(uint64_t);
> >>
> >> How does this work if more than one media element is playing?
> >
> > 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 "Content" 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.
>
> Please make a typedef for this uint64_t (MediaElementID or whatever), and
> 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">>
> Give this a default argument, so you don't have to specify
> HTMLMediaElementInvalidID everywhere.</span >
Done.
<span class="quote">>
> > Source/WebCore/html/HTMLMediaElement.cpp:3177
> > +#if ENABLE(MEDIA_SESSION)
> > + document().updateIsPlayingMedia(m_elementID);
> > +#else
> > + document().updateIsPlayingMedia(0);
> > +#endif
>
> 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">>
> > Source/WebCore/html/HTMLMediaElement.cpp:4545
> > +#if ENABLE(MEDIA_SESSION)
> > + document().updateIsPlayingMedia(m_elementID);
> > +#else
> > + document().updateIsPlayingMedia(0);
> > +#endif
>
> Ditto.
>
> > Source/WebCore/html/HTMLMediaElement.cpp:4810
> > +#if ENABLE(MEDIA_SESSION)
> > + document().updateIsPlayingMedia(m_elementID);
> > +#else
> > + document().updateIsPlayingMedia(0);
> > +#endif
>
> 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>