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: { lengthSeconds: {
type: Number, type: Number,
required: true required: true
},
videoThumbnail: {
type: String,
required: true
} }
}, },
data: function () { 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: { methods: {
goToChannel: function () { goToChannel: function () {
this.$router.push({ path: `/channel/${this.channelId}` }) this.$router.push({ path: `/channel/${this.channelId}` })

View File

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