feat: add MediaMetadata (#2410)
* change browserslist to cover 100% not dead browsers * feat: add MediaMetadata * Revert browserslist change Co-authored-by: Sam Potts <sam@potts.es>
This commit is contained in:
17
src/js/controls.js
vendored
17
src/js/controls.js
vendored
@@ -1749,6 +1749,23 @@ const controls = {
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
// Set media metadata
|
||||
setMediaMetadata() {
|
||||
try {
|
||||
if ('mediaSession' in navigator) {
|
||||
navigator.mediaSession.metadata = new window.MediaMetadata({
|
||||
title: this.config.mediaMetadata.title,
|
||||
artist: this.config.mediaMetadata.artist,
|
||||
album: this.config.mediaMetadata.album,
|
||||
artwork: this.config.mediaMetadata.artwork,
|
||||
});
|
||||
}
|
||||
// eslint-disable-next-line no-empty
|
||||
} catch (e) {}
|
||||
},
|
||||
|
||||
// Add markers
|
||||
setMarkers() {
|
||||
if (this.duration > 0 && !this.elements.markers) {
|
||||
const { points } = this.config.markers;
|
||||
|
||||
Reference in New Issue
Block a user