Skip to content

Commit

Permalink
Fallback to current url as metadata title
Browse files Browse the repository at this point in the history
  • Loading branch information
ferjm committed Nov 20, 2019
1 parent 6ee21af commit d33c96b
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions components/script/dom/htmlmediaelement.rs
Expand Up @@ -1728,10 +1728,15 @@ impl HTMLMediaElement {
self.render_controls();
}

let global = self.global();
let window = global.as_window();

// Send a media session event with the obtained metadata.
self.send_media_session_event(MediaSessionEvent::SetMetadata(MediaMetadata {
// TODO(ferjm) set url if no title.
title: metadata.title.clone().unwrap_or("".to_string()),
title: metadata
.title
.clone()
.unwrap_or(window.get_url().into_string()),
artist: None,
album: None,
}));
Expand Down

0 comments on commit d33c96b

Please sign in to comment.