mirror of
https://github.com/servo/servo.git
synced 2025-08-05 13:40:08 +01:00
Extend libsimpleservo API with a method to request a media session action
This commit is contained in:
parent
31ce7a2b5c
commit
d7d775ac60
1 changed files with 10 additions and 1 deletions
|
@ -19,7 +19,7 @@ use servo::embedder_traits::EmbedderMsg;
|
|||
use servo::euclid::{Point2D, Rect, Scale, Size2D, Vector2D};
|
||||
use servo::keyboard_types::{Key, KeyState, KeyboardEvent};
|
||||
use servo::msg::constellation_msg::TraversalDirection;
|
||||
use servo::script_traits::{TouchEventType, TouchId};
|
||||
use servo::script_traits::{MediaSessionActionType, TouchEventType, TouchId};
|
||||
use servo::servo_config::opts;
|
||||
use servo::servo_config::{pref, set_pref};
|
||||
use servo::servo_url::ServoUrl;
|
||||
|
@ -466,6 +466,15 @@ impl ServoGlue {
|
|||
self.process_event(WindowEvent::Keyboard(key_event))
|
||||
}
|
||||
|
||||
pub fn media_session_action(
|
||||
&mut self,
|
||||
action: MediaSessionActionType,
|
||||
) -> Result<(), &'static str> {
|
||||
info!("Media session action {:?}", action);
|
||||
let browser_id = self.get_browser_id()?;
|
||||
self.process_event(WindowEvent::MediaSessionAction(browser_id, action))
|
||||
}
|
||||
|
||||
fn process_event(&mut self, event: WindowEvent) -> Result<(), &'static str> {
|
||||
self.events.push(event);
|
||||
if !self.batch_mode {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue