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: {
|
props: {
|
||||||
videoId: String,
|
videoId: String,
|
||||||
currentTime: Number,
|
currentTime: Number,
|
||||||
|
playlistId: String,
|
||||||
|
playlistIndex: String,
|
||||||
},
|
},
|
||||||
|
|
||||||
computed: {
|
computed: {
|
||||||
generatedLink() {
|
generatedLink() {
|
||||||
let timestamp = parseInt(this.currentTime);
|
let url = `https://youtu.be/watch?v=${this.videoId}`;
|
||||||
return `https://youtu.be/watch?v=${this.videoId}&t=${timestamp}`;
|
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" />
|
<font-awesome-icon icon="rss" />
|
||||||
</a>
|
</a>
|
||||||
<WatchOnYouTubeButton :video-id="getVideoId()" :current-time="currentTime" />
|
<WatchOnYouTubeButton
|
||||||
|
:video-id="getVideoId()"
|
||||||
|
:current-time="currentTime"
|
||||||
|
:playlist-id="playlistId"
|
||||||
|
:playlist-index="index"
|
||||||
|
/>
|
||||||
<!-- Share Dialog -->
|
<!-- Share Dialog -->
|
||||||
<button class="btn" @click="showShareModal = !showShareModal">
|
<button class="btn" @click="showShareModal = !showShareModal">
|
||||||
<i18n-t class="lt-lg:hidden" keypath="actions.share" tag="strong"></i18n-t>
|
<i18n-t class="lt-lg:hidden" keypath="actions.share" tag="strong"></i18n-t>
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue