mirror of
https://github.com/servo/servo.git
synced 2025-08-05 21:50:18 +01:00
Implement method to remove media controls
This commit is contained in:
parent
142d42a833
commit
23def72787
3 changed files with 24 additions and 6 deletions
|
@ -1788,8 +1788,10 @@ impl HTMLMediaElement {
|
|||
}
|
||||
}
|
||||
|
||||
fn hide_controls(&self) {
|
||||
println!("hide_controls");
|
||||
fn remove_controls(&self) {
|
||||
if let Some(ref id) = *self.media_controls_id.borrow() {
|
||||
document_from_node(self).unregister_media_controls(id);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1833,9 +1835,7 @@ impl Drop for HTMLMediaElement {
|
|||
.unwrap()
|
||||
.shutdown_player(&client_context_id, player.clone());
|
||||
}
|
||||
if let Some(ref id) = *self.media_controls_id.borrow() {
|
||||
document_from_node(self).unregister_media_controls(id);
|
||||
}
|
||||
self.remove_controls();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -2278,7 +2278,7 @@ impl VirtualMethods for HTMLMediaElement {
|
|||
if mutation.new_value(attr).is_some() {
|
||||
self.render_controls();
|
||||
} else {
|
||||
self.hide_controls();
|
||||
self.remove_controls();
|
||||
}
|
||||
},
|
||||
_ => (),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue