Skip to content
Permalink
Browse files

Fallback to current url as metadata title

  • Loading branch information
ferjm committed Nov 15, 2019
1 parent 6ee21af commit d33c96b31e9370dd3254901a3164c78026daf4c9
Showing with 7 additions and 2 deletions.
  1. +7 −2 components/script/dom/htmlmediaelement.rs
@@ -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,
}));

0 comments on commit d33c96b

Please sign in to comment.
You can’t perform that action at this time.