mirror of
https://github.com/TeamPiped/Piped.git
synced 2024-08-14 23:57:27 +00:00
add support for playlists
This commit is contained in:
parent
a34650c9e9
commit
47f53bb238
2 changed files with 15 additions and 3 deletions
|
@ -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;
|
||||
},
|
||||
},
|
||||
};
|
||||
|
|
|
@ -108,7 +108,12 @@
|
|||
>
|
||||
<font-awesome-icon icon="rss" />
|
||||
</a>
|
||||
<WatchOnYouTubeButton :video-id="getVideoId()" :current-time="currentTime" />
|
||||
<WatchOnYouTubeButton
|
||||
:video-id="getVideoId()"
|
||||
:current-time="currentTime"
|
||||
:playlist-id="playlistId"
|
||||
:playlist-index="index"
|
||||
/>
|
||||
<!-- Share Dialog -->
|
||||
<button class="btn" @click="showShareModal = !showShareModal">
|
||||
<i18n-t class="lt-lg:hidden" keypath="actions.share" tag="strong"></i18n-t>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue