diff --git a/components/embedder_traits/lib.rs b/components/embedder_traits/lib.rs index 949b3ba5acb..da526d5f478 100644 --- a/components/embedder_traits/lib.rs +++ b/components/embedder_traits/lib.rs @@ -162,6 +162,9 @@ pub enum EmbedderMsg { Shutdown, /// Report a complete sampled profile ReportProfile(Vec), + /// Sent when a media session is activated or deactivated. + /// There can only be a single active media session. + MediaSession(bool), } impl Debug for EmbedderMsg { @@ -194,6 +197,7 @@ impl Debug for EmbedderMsg { EmbedderMsg::AllowOpeningBrowser(..) => write!(f, "AllowOpeningBrowser"), EmbedderMsg::BrowserCreated(..) => write!(f, "BrowserCreated"), EmbedderMsg::ReportProfile(..) => write!(f, "ReportProfile"), + EmbedderMsg::MediaSession(..) => write!(f, "MediaSession"), } } } diff --git a/ports/libsimpleservo/api/src/lib.rs b/ports/libsimpleservo/api/src/lib.rs index 0984b7c49f3..4f1d0aa6a22 100644 --- a/ports/libsimpleservo/api/src/lib.rs +++ b/ports/libsimpleservo/api/src/lib.rs @@ -130,7 +130,7 @@ pub trait HostTrait { fn get_clipboard_contents(&self) -> Option; /// Sets system clipboard contents fn set_clipboard_contents(&self, contents: String); - /// Called when a media session is activated or deactived. + /// Called when a media session is activated or deactivated. fn on_media_session(&self, active: bool); } @@ -583,6 +583,9 @@ impl ServoGlue { EmbedderMsg::HideIME => { self.callbacks.host_callbacks.on_ime_state_changed(false); }, + EmbedderMsg::MediaSession(active) => { + self.callbacks.host_callbacks.on_media_session(active); + }, EmbedderMsg::Status(..) | EmbedderMsg::SelectFiles(..) | EmbedderMsg::MoveTo(..) |