Skip to content

Commit

Permalink
Do not set metadata until we have enough data
Browse files Browse the repository at this point in the history
  • Loading branch information
ferjm committed Oct 8, 2018
1 parent 5bbd097 commit dba61ad
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion components/script/dom/htmlmediaelement.rs
Expand Up @@ -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.
Expand Down

0 comments on commit dba61ad

Please sign in to comment.