pub struct Video { /* private fields */ }Expand description
A page video capture handle.
See the module docs for the important distinction between captured frames and a muxed video file.
Implementations§
Source§impl Video
impl Video
Sourcepub async fn start(&self, options: Option<VideoStartOptions>) -> Result<()>
pub async fn start(&self, options: Option<VideoStartOptions>) -> Result<()>
Begin capturing screencast frames.
Subscribes to Page.screencastFrame before issuing
Page.startScreencast so the first frame is not missed, then spawns a
writer task that decodes each frame’s base64 image and persists it.
Frames are written under path (see module docs for the output
shape). If path is None, capture still runs and counts frames via
frame_count, but nothing is persisted.
Sourcepub async fn stop(&self) -> Result<()>
pub async fn stop(&self) -> Result<()>
Stop an in-progress cast.
Sends Page.stopScreencast. The writer task winds down when the session
stops emitting Page.screencastFrame. The configured path is retained
so path stays valid after recording.
Sourcepub fn frame_count(&self) -> u64
pub fn frame_count(&self) -> u64
Number of frames captured during the current (or most recent) cast.
Sourcepub fn is_recording(&self) -> bool
pub fn is_recording(&self) -> bool
Whether a cast is currently in progress.