mirror of
https://github.com/TeamPiped/Piped.git
synced 2024-08-14 23:57:27 +00:00
add timestamp to link generated by watchOnYt button
This commit is contained in:
parent
e38a9b4414
commit
e0290203eb
2 changed files with 12 additions and 4 deletions
|
@ -1,7 +1,15 @@
|
|||
<script>
|
||||
export default {
|
||||
props: {
|
||||
link: String,
|
||||
videoId: String,
|
||||
currentTime: Number,
|
||||
},
|
||||
|
||||
computed: {
|
||||
generatedLink() {
|
||||
let timestamp = parseInt(this.currentTime);
|
||||
return `https://youtu.be/watch?v=${this.videoId}&t=${timestamp}`;
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
@ -9,13 +17,13 @@ export default {
|
|||
<template>
|
||||
<template v-if="this.getPreferenceBoolean('showWatchOnYouTube', false)">
|
||||
<!-- For large screens -->
|
||||
<a :href="link" class="btn lt-lg:hidden">
|
||||
<a :href="generatedLink" class="btn lt-lg:hidden">
|
||||
<i18n-t keypath="player.watch_on" tag="strong">
|
||||
<font-awesome-icon class="mx-1.5" :icon="['fab', 'youtube']" />
|
||||
</i18n-t>
|
||||
</a>
|
||||
<!-- For small screens -->
|
||||
<a :href="link" class="btn lg:hidden">
|
||||
<a :href="generatedLink" class="btn lg:hidden">
|
||||
<font-awesome-icon class="mx-1.5" :icon="['fab', 'youtube']" />
|
||||
</a>
|
||||
</template>
|
||||
|
|
|
@ -108,7 +108,7 @@
|
|||
>
|
||||
<font-awesome-icon icon="rss" />
|
||||
</a>
|
||||
<WatchOnYouTubeButton :link="`https://youtu.be/${getVideoId()}`" />
|
||||
<WatchOnYouTubeButton :video-id="getVideoId()" :current-time="currentTime" />
|
||||
<!-- 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