Comments (7)
This relates to the discussion starting at #21 (comment).
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:
- fire multimedia key events against active media sessions. If no active media session is present, fire them as multimedia input events.
- 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.
from mediasession.
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.
from mediasession.
@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:
- If the keypress is will translate to a MediaSession action, it isn't delivered as a KeyboardEvent at all.
- A KeyboardEvent is fired, and only if the event isn't canceled does the MediaSession action happen.
from mediasession.
Ping @jernoble?
from mediasession.
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.
from mediasession.
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.
from mediasession.
Closing, given the spec has been rewritten to no longer talk about key press and so on.
from mediasession.
Related Issues (20)
- Should it be possible for web pages to trigger actions on another page? HOT 3
- Should we add a common repository for MediaSession actions and WebRTC capture handle actions? HOT 2
- Status of AudioFocus API HOT 4
- Definition of active media session and the togglemicrophone, togglecamera, hangup actions HOT 7
- Privacy issue: is it a good idea to let webapps lie about camera/mic ON/OFF on a user's lock screen? HOT 4
- MediaSession API on Edge in showing ANY buttons when entering picture-in-picture HOT 2
- Update explainer with video conferencing actions HOT 1
- Dedicated video conference session API? HOT 2
- Add takephoto action to spec
- The active media session might not be the only one being notified of actions
- MediaSession as a user-constructible object don't work. HOT 1
- Media Session doesn't show artwork on iOS 16.1.1 HOT 3
- mediaSession.setActionHandler not working properly with more than one video element on Chrome HOT 2
- Show album art (song cover) using media session api with jsmediatags api.
- Make PiP mediaSession Mic and Camera icons always visible HOT 1
- EnterPictureInPicture MediaSessionAction HOT 2
- Notification buttons on the lock screen HOT 2
- Top issues for TPAC 2023 HOT 2
- Add WPT mediasession permission policy tests HOT 1
- Should the default mediasession permission policy value be self instead of * HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from mediasession.