Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"When the user presses the MediaTrackPrevious me..." #56

Closed
annevk opened this issue Jun 14, 2015 · 7 comments
Closed

"When the user presses the MediaTrackPrevious me..." #56

annevk opened this issue Jun 14, 2015 · 7 comments

Comments

@annevk
Copy link
Member

annevk commented Jun 14, 2015

https://mediasession.spec.whatwg.org/#mediaremotecontrols-event-handlers

When the user presses the MediaTrackPrevious media key,

How should this happen relative to the task that is already queued for pressing that key? Should it in fact all be part of the same task, or a set of tasks (what order?).

@richtr
Copy link
Member

richtr commented Jun 15, 2015

This relates to the discussion starting at #21 (comment).

@foolip wrote:

My hope is that there wouldn't be any reason to use [existing input events for multimedia keys].

Ideally MediaSession should replace handling for multimedia input events.

For platforms that do currently fire multimedia key events we have three options:

  1. fire multimedia key events against active media sessions. If no active media session is present, fire them as multimedia input events.
  2. fire multimedia key events against active media sessions. If no active media session is present, do not fire multimedia input events at all.

The other proposal is to fire media session events after keyboard events:
3. fire keyboard multimedia key events normally and if they are not preventDefault()ed then continue to fire them again at active media sessions, if any.

Of the three options, my preference would be on (2). Once we know the order we want to fire these events (or if we want to continue firing multimedia key events as input events at all) I think we can start to look at the event timing/ordering text we need to add to the spec.

foolip added a commit to foolip/mediasession that referenced this issue Aug 25, 2015
There are a few open issues around remote controls:
w3c#11
w3c#21
w3c#42
w3c#45
w3c#56

In particular issue 45 will change this API a lot, so in order to not
tempt implementors into going with this design, remove it for now.

Much of this, in particular the prose and example, can be revived
once we have the time to hammer out the flattened API design.
@mounirlamouri mounirlamouri self-assigned this Dec 9, 2016
@mounirlamouri
Copy link
Member

We need implementer feedback on this. I'm not sure what the timing should be and whether cancelling a key event should block the media session action. At the moment, Chrome did not implement an action that is also a key event so I prefer not to write something in the spec without any implementation feedback.

@foolip
Copy link
Member

foolip commented Jan 26, 2017

@jernoble, there's some chance you'll be the first to try to tie actions to keys on a keyboard, any thoughts?

FWIW, I can see two relative sane options:

  1. If the keypress is will translate to a MediaSession action, it isn't delivered as a KeyboardEvent at all.
  2. A KeyboardEvent is fired, and only if the event isn't canceled does the MediaSession action happen.

@foolip
Copy link
Member

foolip commented Feb 14, 2017

Ping @jernoble?

@jernoble
Copy link

AFAICT, I don't think that the media buttons will ever generate key events on Mac platforms. That they're on the keyboard (on non-Touch Bar Macs) is coincidental.

@youennf
Copy link
Contributor

youennf commented Mar 6, 2023

I think @jernoble comment still holds on Apple platforms.
If there is no change in implementations where a keypress might trigger both an event and a media session action, we could document this in the spec.
Marking as "Ready for PR" for now.

@youennf youennf added this to the V1 milestone Mar 14, 2023
@youennf
Copy link
Contributor

youennf commented Apr 4, 2023

Closing, given the spec has been rewritten to no longer talk about key press and so on.

@youennf youennf closed this as completed Apr 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

7 participants