mirror of
https://github.com/servo/servo.git
synced 2025-07-23 07:13:52 +01:00
Fallback to current url as metadata title
This commit is contained in:
parent
6ee21af0c4
commit
d33c96b31e
1 changed files with 7 additions and 2 deletions
|
@ -1728,10 +1728,15 @@ impl HTMLMediaElement {
|
||||||
self.render_controls();
|
self.render_controls();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
let global = self.global();
|
||||||
|
let window = global.as_window();
|
||||||
|
|
||||||
// Send a media session event with the obtained metadata.
|
// Send a media session event with the obtained metadata.
|
||||||
self.send_media_session_event(MediaSessionEvent::SetMetadata(MediaMetadata {
|
self.send_media_session_event(MediaSessionEvent::SetMetadata(MediaMetadata {
|
||||||
// TODO(ferjm) set url if no title.
|
title: metadata
|
||||||
title: metadata.title.clone().unwrap_or("".to_string()),
|
.title
|
||||||
|
.clone()
|
||||||
|
.unwrap_or(window.get_url().into_string()),
|
||||||
artist: None,
|
artist: None,
|
||||||
album: None,
|
album: None,
|
||||||
}));
|
}));
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue