Skip to content

Commit

Permalink
Merge pull request #401 from polyfloyd/feat-screencast
Browse files Browse the repository at this point in the history
Add support for the screencast API
  • Loading branch information
mdrokz committed Jul 20, 2023
2 parents 38858c9 + 1217db0 commit e99b591
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions src/browser/tab/mod.rs
Expand Up @@ -1825,4 +1825,32 @@ impl Tab {
self.bypass_webgl_vendor()?;
Ok(())
}

pub fn start_screencast(
&self,
format: Option<Page::StartScreencastFormatOption>,
quality: Option<u32>,
max_width: Option<u32>,
max_height: Option<u32>,
every_nth_frame: Option<u32>,
) -> Result<()> {
self.call_method(Page::StartScreencast {
format,
quality,
max_width,
max_height,
every_nth_frame,
})?;
Ok(())
}

pub fn stop_screencast(&self) -> Result<()> {
self.call_method(Page::StopScreencast(None))?;
Ok(())
}

pub fn ack_screencast(&self, session_id: u32) -> Result<()> {
self.call_method(Page::ScreencastFrameAck { session_id })?;
Ok(())
}
}

0 comments on commit e99b591

Please sign in to comment.