Bug 147745 - Media Session: notify focus manager clients when the playing state of the focused media element changes
Summary: Media Session: notify focus manager clients when the playing state of the foc...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Media (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks: 145411
  Show dependency treegraph
 
Reported: 2015-08-06 14:06 PDT by Matt Rajca
Modified: 2015-08-06 17:01 PDT (History)
4 users (show)

See Also:


Attachments
Patch (15.71 KB, patch)
2015-08-06 14:25 PDT, Matt Rajca
no flags Details | Formatted Diff | Diff
Patch (16.03 KB, patch)
2015-08-06 16:20 PDT, Matt Rajca
no flags Details | Formatted Diff | Diff
Patch (16.04 KB, patch)
2015-08-06 16:32 PDT, Matt Rajca
no flags Details | Formatted Diff | Diff
Patch (16.11 KB, patch)
2015-08-06 16:37 PDT, Matt Rajca
no flags Details | Formatted Diff | Diff
Patch (16.06 KB, patch)
2015-08-06 16:45 PDT, Matt Rajca
thorton: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Matt Rajca 2015-08-06 14:06:41 PDT
Clients that display lock screen UIs should be able to change their play button to a pause button (and vice versa) when the 'playing' state of the focused Content media element changes.
Comment 1 Matt Rajca 2015-08-06 14:25:28 PDT
Created attachment 258396 [details]
Patch
Comment 2 Eric Carlson 2015-08-06 14:40:50 PDT
Comment on attachment 258396 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=258396&action=review

> Source/WebKit2/UIProcess/API/C/WKMediaSessionFocusManager.h:40
> +typedef void (*WKMediaSessionFocusManagerDidChangePlayingState)(WKMediaSessionFocusManagerRef manager, bool isPaused, const void *clientInfo);

Will this ever have to handle more than play/pause state changes? If so, I recommend changing the names to PlaybackState instead of PlayingState and passing flags instead of a bool.
Comment 3 Matt Rajca 2015-08-06 15:25:20 PDT
(In reply to comment #2)
> Comment on attachment 258396 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=258396&action=review
> 
> > Source/WebKit2/UIProcess/API/C/WKMediaSessionFocusManager.h:40
> > +typedef void (*WKMediaSessionFocusManagerDidChangePlayingState)(WKMediaSessionFocusManagerRef manager, bool isPaused, const void *clientInfo);
> 
> Will this ever have to handle more than play/pause state changes? If so, I
> recommend changing the names to PlaybackState instead of PlayingState and
> passing flags instead of a bool.

Good idea. In the future, we'll also need to notify clients whenever the previous/next track controls should be enabled/disabled. I'll generalize this code path so we can use it for said events.
Comment 4 Matt Rajca 2015-08-06 16:20:28 PDT
Created attachment 258419 [details]
Patch
Comment 5 Matt Rajca 2015-08-06 16:32:14 PDT
Created attachment 258421 [details]
Patch
Comment 6 Matt Rajca 2015-08-06 16:37:53 PDT
Created attachment 258422 [details]
Patch
Comment 7 Matt Rajca 2015-08-06 16:45:14 PDT
Created attachment 258423 [details]
Patch
Comment 8 Matt Rajca 2015-08-06 17:01:42 PDT
Committed r188097: <http://trac.webkit.org/changeset/188097>