aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/dom/htmlmediaelement.rs
diff options
context:
space:
mode:
Diffstat (limited to 'components/script/dom/htmlmediaelement.rs')
-rw-r--r--components/script/dom/htmlmediaelement.rs9
1 files changed, 7 insertions, 2 deletions
diff --git a/components/script/dom/htmlmediaelement.rs b/components/script/dom/htmlmediaelement.rs
index da8ffd76aed..333412ed3cd 100644
--- a/components/script/dom/htmlmediaelement.rs
+++ b/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,
}));