mirror of
https://github.com/servo/servo.git
synced 2025-08-03 04:30:10 +01:00
Make MediaSession handle embedder requested action
This commit is contained in:
parent
6233f78de4
commit
fa61191405
2 changed files with 9 additions and 1 deletions
|
@ -15,6 +15,7 @@ use crate::dom::window::Window;
|
||||||
use crate::script_thread::ScriptThread;
|
use crate::script_thread::ScriptThread;
|
||||||
use dom_struct::dom_struct;
|
use dom_struct::dom_struct;
|
||||||
use msg::constellation_msg::TopLevelBrowsingContextId;
|
use msg::constellation_msg::TopLevelBrowsingContextId;
|
||||||
|
use script_traits::MediaSessionActionType;
|
||||||
use std::rc::Rc;
|
use std::rc::Rc;
|
||||||
|
|
||||||
#[dom_struct]
|
#[dom_struct]
|
||||||
|
@ -46,6 +47,10 @@ impl MediaSession {
|
||||||
MediaSessionBinding::Wrap,
|
MediaSessionBinding::Wrap,
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pub fn handle_action(&self, action: MediaSessionActionType) {
|
||||||
|
// TODO
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl MediaSessionMethods for MediaSession {
|
impl MediaSessionMethods for MediaSession {
|
||||||
|
|
|
@ -3941,7 +3941,10 @@ impl ScriptThread {
|
||||||
browsing_context_id: TopLevelBrowsingContextId,
|
browsing_context_id: TopLevelBrowsingContextId,
|
||||||
action: MediaSessionActionType,
|
action: MediaSessionActionType,
|
||||||
) {
|
) {
|
||||||
// TODO
|
match self.media_sessions.borrow().get(&browsing_context_id) {
|
||||||
|
Some(session) => session.handle_action(action),
|
||||||
|
None => warn!("No MediaSession for this browsing context"),
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn enqueue_microtask(job: Microtask) {
|
pub fn enqueue_microtask(job: Microtask) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue