aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/dom/htmlmediaelement.rs
diff options
context:
space:
mode:
authorFernando Jiménez Moreno <ferjmoreno@gmail.com>2018-09-21 17:49:13 +0200
committerFernando Jiménez Moreno <ferjmoreno@gmail.com>2018-10-08 16:12:03 +0200
commitdba61ad1df38edd4a0d6fd911d61bbe26295d167 (patch)
tree22481041fc8d451d30cc54cc88318e3067afb44e /components/script/dom/htmlmediaelement.rs
parent5bbd09769c3d8910a11d014ed512a0e40f093c18 (diff)
downloadservo-dba61ad1df38edd4a0d6fd911d61bbe26295d167.tar.gz
servo-dba61ad1df38edd4a0d6fd911d61bbe26295d167.zip
Do not set metadata until we have enough data
Diffstat (limited to 'components/script/dom/htmlmediaelement.rs')
-rw-r--r--components/script/dom/htmlmediaelement.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/components/script/dom/htmlmediaelement.rs b/components/script/dom/htmlmediaelement.rs
index df29a860a3f..3a573fa0b81 100644
--- a/components/script/dom/htmlmediaelement.rs
+++ b/components/script/dom/htmlmediaelement.rs
@@ -969,7 +969,7 @@ impl HTMLMediaElement {
fn handle_player_event(&self, event: &PlayerEvent) {
match *event {
PlayerEvent::MetadataUpdated(ref metadata) => {
- if !self.have_metadata.get() {
+ if !self.have_metadata.get() && metadata.duration.is_some() {
// https://html.spec.whatwg.org/multipage/#media-data-processing-steps-list
// => "Once enough of the media data has been fetched to determine the duration..."
// Step 1.