mirror of
https://github.com/servo/servo.git
synced 2025-07-23 07:13:52 +01:00
implement get_image_pixels() for video element
This commit is contained in:
parent
bc07154e05
commit
b75d454162
4 changed files with 48 additions and 3 deletions
|
@ -136,6 +136,10 @@ impl FrameHolder {
|
|||
unreachable!();
|
||||
}
|
||||
}
|
||||
|
||||
fn get_frame(&self) -> Frame {
|
||||
self.1.clone()
|
||||
}
|
||||
}
|
||||
|
||||
pub struct MediaFrameRenderer {
|
||||
|
@ -1857,6 +1861,13 @@ impl HTMLMediaElement {
|
|||
document_from_node(self).unregister_media_controls(&id);
|
||||
}
|
||||
}
|
||||
|
||||
pub fn get_current_frame(&self) -> Option<Frame> {
|
||||
match self.frame_renderer.lock().unwrap().current_frame_holder {
|
||||
Some(ref holder) => Some(holder.get_frame()),
|
||||
None => return None,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// XXX Placeholder for [https://github.com/servo/servo/issues/22293]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue