-
Notifications
You must be signed in to change notification settings - Fork 423
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
Add Media Session types #821
Conversation
You might want to check |
I spent a couple of hours hacking around in the |
We might need some documentation for those files... For now, something like this should work. "callback-functions": {
"callback-function": {
"MediaSessionActionHandler": {
"name": "MediaSessionActionHandler",
"override-signatures": [
"(details: MediaSessionSeekActionDetails): void"
]
}
}
} And for "interfaces": {
"interface": {
"MediaSession": {
"methods": {
"method": {
"setActionHandler": {
"additional-signatures": [
"setActionHandler(action: 'seekbackward' | 'seekforward', handler: MediaSessionSeekActionHandler | null): void"
]
}
}
}
}
}
} |
Additionally, caniuse.com says that only Chrome (and new Edge) support MediaSession API, so I want to wait until another browser supports this API before putting it in the standard library. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should wait until more than one engine implements it.
Fair enough |
It seems MediaSession API has landed Firefox in version 82. |
This is shipped by #1034 @github-actions close |
Closing because @saschanaz is a code-owner of all the changes. |
This adds types for the Media Session API. Fixes microsoft/TypeScript#19473
The only thing that could be improved with the types is that:
should really be:
But I couldn't figure out how to insert the additional interfaces and the
MediaSessionSeekActionDetails
andMediaSessionSeekToActionDetails
types from the widl file.