Bug 146028

Summary: MediaSession: handle MediaEventTrackNext and MediaEventTrackPrevious events
Product: WebKit Reporter: Matt Rajca <mrajca>
Component: MediaAssignee: Nobody <webkit-unassigned>
Status: RESOLVED FIXED    
Severity: Normal CC: conrad_shultz, eric.carlson, jer.noble, jonlee, mrajca, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: 528+ (Nightly build)   
Hardware: All   
OS: All   
Bug Depends on:    
Bug Blocks: 145411    
Attachments:
Description Flags
Patch darin: review+

Matt Rajca
Reported 2015-06-16 14:49:45 PDT
In addition to play/pause events, we need to handle the media control events for skipping to the next / previous track.
Attachments
Patch (7.02 KB, patch)
2015-06-16 15:26 PDT, Matt Rajca
darin: review+
Radar WebKit Bug Importer
Comment 1 2015-06-16 14:53:18 PDT
Matt Rajca
Comment 2 2015-06-16 15:26:01 PDT
Darin Adler
Comment 3 2015-06-17 15:22:25 PDT
Comment on attachment 254970 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=254970&action=review > Source/WebCore/Modules/mediasession/MediaSessionManager.cpp:67 > + if (session->currentState() == MediaSession::State::Active && session->kind() == "content") Generally it’s not good for an enum value to be a string literal at each call site like this. It’s easy to have a typo and the compiler won’t catch it. I suggest making constants for these special kind values somewhere, so that we get a compile time error if we spell it wrong somewhere.
Matt Rajca
Comment 4 2015-06-17 15:46:50 PDT
(In reply to comment #3) > Comment on attachment 254970 [details] > Patch > > View in context: > https://bugs.webkit.org/attachment.cgi?id=254970&action=review > > > Source/WebCore/Modules/mediasession/MediaSessionManager.cpp:67 > > + if (session->currentState() == MediaSession::State::Active && session->kind() == "content") > > Generally it’s not good for an enum value to be a string literal at each > call site like this. It’s easy to have a typo and the compiler won’t catch > it. I suggest making constants for these special kind values somewhere, so > that we get a compile time error if we spell it wrong somewhere. Fixed. I didn't see us using many string constants in WebCore.
Matt Rajca
Comment 5 2015-06-17 17:03:24 PDT
Eric Carlson
Comment 6 2015-06-18 09:47:06 PDT
(In reply to comment #4) > (In reply to comment #3) > > Comment on attachment 254970 [details] > > Patch > > > > View in context: > > https://bugs.webkit.org/attachment.cgi?id=254970&action=review > > > > > Source/WebCore/Modules/mediasession/MediaSessionManager.cpp:67 > > > + if (session->currentState() == MediaSession::State::Active && session->kind() == "content") > > > > Generally it’s not good for an enum value to be a string literal at each > > call site like this. It’s easy to have a typo and the compiler won’t catch > > it. I suggest making constants for these special kind values somewhere, so > > that we get a compile time error if we spell it wrong somewhere. > > Fixed. I didn't see us using many string constants in WebCore. Look at the newer enums exposed to JavaScript, for example TextTrackMode and TextTrackKind in TextTrack.idl/.cpp/.h
Note You need to log in before you can comment on or make changes to this bug.