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>
|
<script>
|
||||||
export default {
|
export default {
|
||||||
props: {
|
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>
|
</script>
|
||||||
|
@ -9,13 +17,13 @@ export default {
|
||||||
<template>
|
<template>
|
||||||
<template v-if="this.getPreferenceBoolean('showWatchOnYouTube', false)">
|
<template v-if="this.getPreferenceBoolean('showWatchOnYouTube', false)">
|
||||||
<!-- For large screens -->
|
<!-- 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">
|
<i18n-t keypath="player.watch_on" tag="strong">
|
||||||
<font-awesome-icon class="mx-1.5" :icon="['fab', 'youtube']" />
|
<font-awesome-icon class="mx-1.5" :icon="['fab', 'youtube']" />
|
||||||
</i18n-t>
|
</i18n-t>
|
||||||
</a>
|
</a>
|
||||||
<!-- For small screens -->
|
<!-- 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']" />
|
<font-awesome-icon class="mx-1.5" :icon="['fab', 'youtube']" />
|
||||||
</a>
|
</a>
|
||||||
</template>
|
</template>
|
||||||
|
|
|
@ -108,7 +108,7 @@
|
||||||
>
|
>
|
||||||
<font-awesome-icon icon="rss" />
|
<font-awesome-icon icon="rss" />
|
||||||
</a>
|
</a>
|
||||||
<WatchOnYouTubeButton :link="`https://youtu.be/${getVideoId()}`" />
|
<WatchOnYouTubeButton :video-id="getVideoId()" :current-time="currentTime" />
|
||||||
<!-- 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