diff --git a/src/components/WatchOnYouTubeButton.vue b/src/components/WatchOnYouTubeButton.vue index 980ae71f..6dea95d1 100644 --- a/src/components/WatchOnYouTubeButton.vue +++ b/src/components/WatchOnYouTubeButton.vue @@ -3,12 +3,19 @@ export default { props: { videoId: String, currentTime: Number, + playlistId: String, + playlistIndex: String, }, computed: { generatedLink() { - let timestamp = parseInt(this.currentTime); - return `https://youtu.be/watch?v=${this.videoId}&t=${timestamp}`; + let url = `https://youtu.be/watch?v=${this.videoId}`; + if (this.playlistId != undefined) { + // If this.playlistId is defined then this.playlistIndex is too. + url += `&list=${this.playlistId}&index=${this.playlistIndex}`; + } + url += `&t=${parseInt(this.currentTime)}`; + return url; }, }, }; diff --git a/src/components/WatchVideo.vue b/src/components/WatchVideo.vue index 1e2b22af..18bbb1e2 100644 --- a/src/components/WatchVideo.vue +++ b/src/components/WatchVideo.vue @@ -108,7 +108,12 @@ > - +