From 3d5ccdc4dc395aa48a216a6253d4eced5b16f5f2 Mon Sep 17 00:00:00 2001 From: Preston Date: Sun, 21 Feb 2021 22:07:50 -0500 Subject: [PATCH] Add better information to media notifications --- .../components/watch-video-info/watch-video-info.js | 12 ++++++++++++ src/renderer/views/Watch/Watch.vue | 1 + 2 files changed, 13 insertions(+) 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 52356b3d..9a54283e 100644 --- a/src/renderer/components/watch-video-info/watch-video-info.js +++ b/src/renderer/components/watch-video-info/watch-video-info.js @@ -90,6 +90,10 @@ export default Vue.extend({ lengthSeconds: { type: Number, required: true + }, + videoThumbnail: { + type: String, + required: true } }, data: function () { @@ -223,6 +227,14 @@ export default Vue.extend({ } } }, + mounted: function () { + /* eslint-disable-next-line */ + navigator.mediaSession.metadata = new MediaMetadata({ + title: this.title, + artist: this.channelName, + artwork: this.videoThumbnail + }) + }, methods: { goToChannel: function () { this.$router.push({ path: `/channel/${this.channelId}` }) diff --git a/src/renderer/views/Watch/Watch.vue b/src/renderer/views/Watch/Watch.vue index 8202edde..cb428351 100644 --- a/src/renderer/views/Watch/Watch.vue +++ b/src/renderer/views/Watch/Watch.vue @@ -82,6 +82,7 @@ :watching-playlist="watchingPlaylist" :theatre-possible="theatrePossible" :length-seconds="videoLengthSeconds" + :video-thumbnail="thumbnail" class="watchVideo" :class="{ theatreWatchVideo: useTheatreMode }" @theatre-mode="toggleTheatreMode"