mirror of
https://github.com/servo/servo.git
synced 2025-06-06 16:45:39 +00:00
Handle media session action, no default handling yet
This commit is contained in:
parent
ec7a4bf32d
commit
31ce7a2b5c
2 changed files with 9 additions and 2 deletions
|
@ -2,6 +2,7 @@
|
|||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
|
||||
|
||||
use crate::dom::bindings::callback::ExceptionHandling;
|
||||
use crate::dom::bindings::cell::DomRefCell;
|
||||
use crate::dom::bindings::codegen::Bindings::MediaSessionBinding;
|
||||
use crate::dom::bindings::codegen::Bindings::MediaSessionBinding::MediaSessionAction;
|
||||
|
@ -54,7 +55,13 @@ impl MediaSession {
|
|||
}
|
||||
|
||||
pub fn handle_action(&self, action: MediaSessionActionType) {
|
||||
// TODO
|
||||
if let Some(handler) = self.action_handlers.borrow().get(&action) {
|
||||
if handler.Call__(ExceptionHandling::Report).is_err() {
|
||||
warn!("Error calling MediaSessionActionHandler callback");
|
||||
}
|
||||
return;
|
||||
}
|
||||
// TODO default action.
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -42,7 +42,7 @@ dictionary MediaSessionSeekToActionDetails : MediaSessionActionDetails {
|
|||
boolean? fastSeek;
|
||||
};
|
||||
|
||||
callback MediaSessionActionHandler = void(MediaSessionActionDetails details);
|
||||
callback MediaSessionActionHandler = void(/*MediaSessionActionDetails details*/);
|
||||
|
||||
[Exposed=Window]
|
||||
interface MediaSession {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue