-
Notifications
You must be signed in to change notification settings - Fork 29
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
Transform MediaSession.kind into a set of bools/enums #46
Comments
Some combinations don't make sense, do they? E.g. |
There's a certain simplicity in having a As a web dev, I would much prefer to do These bools/enums also don't capture other behaviors like whether you want media key access or want to show interfaces in the notification or lock screen. There is probably a compromise in here, where |
For the combinations that don't make sense, we could throw an exception or (preferably) just coerce it into a state that does make sense, so |
For some context, my concern here is that we'll have to double the number of kinds if a new aspect of media sessions are added, or have a mix of kind and bools. There is already one somewhat sensible thing we cannot express, namely a non-transient session that interrupts other playback, like content, but which also automatically pauses and resumes when it goes into the background, like ambient. |
Fwiw, foolip's last use case is present and called SoloAmbient on iOS. |
Something like
But it is not called |
Since we have not been able to actually come up with something better here, I'm going to close this. @domenic, I know you supported this idea, so if you have some ideas for improvement please just suggest it and we'll try it out. |
The MediaSession kind corresponds to a number of behaviors (does it interrupt others, can it mix with others, etc.) that we could expose directly:
The content kind would correspond to all of these being false, while e.g. transient-solo is
{transient: true, mixable: false }
.In this setup, kinds would be a matter for HTMLMediaElement only.
The text was updated successfully, but these errors were encountered: