mirror of
https://github.com/servo/servo.git
synced 2025-08-03 12:40:06 +01:00
Do not render controls until we have metadata
This commit is contained in:
parent
f16cf2d6a4
commit
3a99c6ba6a
1 changed files with 9 additions and 0 deletions
|
@ -1648,6 +1648,12 @@ impl HTMLMediaElement {
|
|||
// https://github.com/servo/media/issues/156
|
||||
|
||||
// Step 12 & 13 are already handled by the earlier media track processing.
|
||||
|
||||
// We wait until we have metadata to render the controls, so we render them
|
||||
// with the appropriate size.
|
||||
if self.Controls() {
|
||||
self.render_controls();
|
||||
}
|
||||
},
|
||||
PlayerEvent::NeedData => {
|
||||
// The player needs more data.
|
||||
|
@ -1725,6 +1731,9 @@ impl HTMLMediaElement {
|
|||
}
|
||||
|
||||
fn render_controls(&self) {
|
||||
if self.ready_state.get() < ReadyState::HaveMetadata {
|
||||
return;
|
||||
}
|
||||
// XXX cannot render controls while parsing.
|
||||
// XXX check that controls are not already rendered.
|
||||
let element = self.htmlelement.upcast::<Element>();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue