Add better information to media notifications

This commit is contained in:
Preston 2021-02-21 22:07:50 -05:00
parent d82e89e982
commit 3d5ccdc4dc
2 changed files with 13 additions and 0 deletions

View File

@ -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}` })

View File

@ -82,6 +82,7 @@
:watching-playlist="watchingPlaylist"
:theatre-possible="theatrePossible"
:length-seconds="videoLengthSeconds"
:video-thumbnail="thumbnail"
class="watchVideo"
:class="{ theatreWatchVideo: useTheatreMode }"
@theatre-mode="toggleTheatreMode"