mirror of
https://github.com/servo/servo.git
synced 2025-06-06 16:45:39 +00: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();
|
||||
}
|
||||
|
||||
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,
|
||||
}));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue