From 77d2e7a6ee07818697f6b9711f50d158a0eb5865 Mon Sep 17 00:00:00 2001 From: Preston Date: Sat, 27 Feb 2021 15:15:06 -0500 Subject: [PATCH] Fix MediaMetadata setter --- .../watch-video-info/watch-video-info.js | 20 +++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/src/renderer/components/watch-video-info/watch-video-info.js b/src/renderer/components/watch-video-info/watch-video-info.js index 9a54283e..0c35afb8 100644 --- a/src/renderer/components/watch-video-info/watch-video-info.js +++ b/src/renderer/components/watch-video-info/watch-video-info.js @@ -228,12 +228,20 @@ export default Vue.extend({ } }, mounted: function () { - /* eslint-disable-next-line */ - navigator.mediaSession.metadata = new MediaMetadata({ - title: this.title, - artist: this.channelName, - artwork: this.videoThumbnail - }) + if ('mediaSession' in navigator) { + /* eslint-disable-next-line */ + navigator.mediaSession.metadata = new MediaMetadata({ + title: this.title, + artist: this.channelName, + artwork: [ + { + src: this.videoThumbnail, + sizes: '128x128', + type: 'image/png' + } + ] + }) + } }, methods: { goToChannel: function () {