Implement method to remove media controls

This commit is contained in:
Fernando Jiménez Moreno 2019-05-13 14:33:55 +02:00
parent 142d42a833
commit 23def72787
3 changed files with 24 additions and 6 deletions

View file

@ -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();
}
},
_ => (),