Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for the screencast API #401

Merged
merged 1 commit into from Jul 20, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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(())
}
}