mirror of
https://github.com/servo/servo.git
synced 2025-08-02 12:10:29 +01:00
Register media instance with session and prepare communication with embedder
This commit is contained in:
parent
9c329a7935
commit
4d147d2c56
8 changed files with 107 additions and 4 deletions
|
@ -3993,6 +3993,19 @@ impl ScriptThread {
|
|||
.remove(&browsing_context_id);
|
||||
})
|
||||
}
|
||||
|
||||
pub fn get_media_session(
|
||||
browsing_context_id: TopLevelBrowsingContextId,
|
||||
) -> Option<DomRoot<MediaSession>> {
|
||||
SCRIPT_THREAD_ROOT.with(|root| {
|
||||
let script_thread = unsafe { &*root.get().unwrap() };
|
||||
script_thread
|
||||
.media_sessions
|
||||
.borrow()
|
||||
.get(&browsing_context_id)
|
||||
.map(|s| DomRoot::from_ref(&**s))
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
impl Drop for ScriptThread {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue