Fix buttons UI under video player, add icon for Odysee (#2551)

Co-authored-by: Bnyro <bnyro@tutanota.com>
This commit is contained in:
Nyte 2023-06-16 17:07:35 +02:00 committed by GitHub
parent 404d5b8cd0
commit 840e844947
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 40 additions and 40 deletions

View file

@ -44,7 +44,7 @@
<CollapsableText :text="channel.description" /> <CollapsableText :text="channel.description" />
<WatchOnYouTubeButton :link="`https://youtube.com/channel/${this.channel.id}`" /> <WatchOnButton :link="`https://youtube.com/channel/${this.channel.id}`" />
<div class="flex my-2 mx-1"> <div class="flex my-2 mx-1">
<button <button
@ -76,7 +76,7 @@
<script> <script>
import ErrorHandler from "./ErrorHandler.vue"; import ErrorHandler from "./ErrorHandler.vue";
import ContentItem from "./ContentItem.vue"; import ContentItem from "./ContentItem.vue";
import WatchOnYouTubeButton from "./WatchOnYouTubeButton.vue"; import WatchOnButton from "./WatchOnButton.vue";
import LoadingIndicatorPage from "./LoadingIndicatorPage.vue"; import LoadingIndicatorPage from "./LoadingIndicatorPage.vue";
import CollapsableText from "./CollapsableText.vue"; import CollapsableText from "./CollapsableText.vue";
@ -84,7 +84,7 @@ export default {
components: { components: {
ErrorHandler, ErrorHandler,
ContentItem, ContentItem,
WatchOnYouTubeButton, WatchOnButton,
LoadingIndicatorPage, LoadingIndicatorPage,
CollapsableText, CollapsableText,
}, },

View file

@ -28,7 +28,7 @@
<a class="btn mr-1" :href="getRssUrl"> <a class="btn mr-1" :href="getRssUrl">
<font-awesome-icon icon="rss" /> <font-awesome-icon icon="rss" />
</a> </a>
<WatchOnYouTubeButton :link="`https://www.youtube.com/playlist?list=${this.$route.query.list}`" /> <WatchOnButton :link="`https://www.youtube.com/playlist?list=${this.$route.query.list}`" />
</div> </div>
</div> </div>
@ -55,13 +55,13 @@ import ErrorHandler from "./ErrorHandler.vue";
import LoadingIndicatorPage from "./LoadingIndicatorPage.vue"; import LoadingIndicatorPage from "./LoadingIndicatorPage.vue";
import CollapsableText from "./CollapsableText.vue"; import CollapsableText from "./CollapsableText.vue";
import VideoItem from "./VideoItem.vue"; import VideoItem from "./VideoItem.vue";
import WatchOnYouTubeButton from "./WatchOnYouTubeButton.vue"; import WatchOnButton from "./WatchOnButton.vue";
export default { export default {
components: { components: {
ErrorHandler, ErrorHandler,
VideoItem, VideoItem,
WatchOnYouTubeButton, WatchOnButton,
LoadingIndicatorPage, LoadingIndicatorPage,
CollapsableText, CollapsableText,
}, },

View file

@ -0,0 +1,26 @@
<script>
export default {
props: {
link: String,
platform: {
type: String,
required: false,
default: "YouTube",
},
},
};
</script>
<template>
<template v-if="this.getPreferenceBoolean('showWatchOnYouTube', false)">
<!-- For large screens -->
<a :href="link" class="btn lt-lg:hidden flex items-center">
<i18n-t keypath="player.watch_on" tag="strong">{{ platform }}</i18n-t>
<font-awesome-icon class="mx-1.5" :icon="['fab', platform.toLowerCase()]" />
</a>
<!-- For small screens -->
<a :href="link" class="btn lg:hidden flex items-center">
<font-awesome-icon class="mx-1.5" :icon="['fab', platform.toLowerCase()]" />
</a>
</template>
</template>

View file

@ -1,22 +0,0 @@
<script>
export default {
props: {
link: String,
},
};
</script>
<template>
<template v-if="this.getPreferenceBoolean('showWatchOnYouTube', false)">
<!-- For large screens -->
<a :href="link" 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">
<font-awesome-icon class="mx-1.5" :icon="['fab', 'youtube']" />
</a>
</template>
</template>

View file

@ -113,20 +113,15 @@
> >
<font-awesome-icon class="mx-1.5" icon="rss" /> <font-awesome-icon class="mx-1.5" icon="rss" />
</a> </a>
<WatchOnYouTubeButton :link="`https://youtu.be/${getVideoId()}`" />
<!-- Share Dialog --> <!-- Share Dialog -->
<button class="btn flex items-center" @click="showShareModal = !showShareModal"> <button class="btn flex items-center" @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>
<font-awesome-icon class="mx-1.5" icon="fa-share" /> <font-awesome-icon class="mx-1.5" icon="fa-share" />
</button> </button>
<!-- LBRY --> <!-- YouTube -->
<a <WatchOnButton :link="`https://youtu.be/${getVideoId()}`" />
v-if="video.lbryId" <!-- Odysee -->
:href="'https://odysee.com/' + video.lbryId" <WatchOnButton :link="`https://odysee.com/${video.lbryId}`" platform="Odysee" />
class="btn flex items-center"
>
<i18n-t keypath="player.watch_on" tag="strong">LBRY</i18n-t>
</a>
<!-- listen / watch toggle --> <!-- listen / watch toggle -->
<router-link <router-link
:to="toggleListenUrl" :to="toggleListenUrl"
@ -236,7 +231,7 @@ import ChaptersBar from "./ChaptersBar.vue";
import PlaylistAddModal from "./PlaylistAddModal.vue"; import PlaylistAddModal from "./PlaylistAddModal.vue";
import ShareModal from "./ShareModal.vue"; import ShareModal from "./ShareModal.vue";
import PlaylistVideos from "./PlaylistVideos.vue"; import PlaylistVideos from "./PlaylistVideos.vue";
import WatchOnYouTubeButton from "./WatchOnYouTubeButton.vue"; import WatchOnButton from "./WatchOnButton.vue";
import LoadingIndicatorPage from "./LoadingIndicatorPage.vue"; import LoadingIndicatorPage from "./LoadingIndicatorPage.vue";
import ToastComponent from "./ToastComponent.vue"; import ToastComponent from "./ToastComponent.vue";
import { parseTimeParam } from "@/utils/Misc"; import { parseTimeParam } from "@/utils/Misc";
@ -252,7 +247,7 @@ export default {
PlaylistAddModal, PlaylistAddModal,
ShareModal, ShareModal,
PlaylistVideos, PlaylistVideos,
WatchOnYouTubeButton, WatchOnButton,
LoadingIndicatorPage, LoadingIndicatorPage,
ToastComponent, ToastComponent,
}, },

View file

@ -23,7 +23,7 @@ import {
faBookmark, faBookmark,
faEdit, faEdit,
} from "@fortawesome/free-solid-svg-icons"; } from "@fortawesome/free-solid-svg-icons";
import { faGithub, faBitcoin, faYoutube } from "@fortawesome/free-brands-svg-icons"; import { faGithub, faBitcoin, faYoutube, faOdysee } from "@fortawesome/free-brands-svg-icons";
import { FontAwesomeIcon } from "@fortawesome/vue-fontawesome"; import { FontAwesomeIcon } from "@fortawesome/vue-fontawesome";
library.add( library.add(
faEye, faEye,
@ -34,6 +34,7 @@ library.add(
faHeart, faHeart,
faHeadphones, faHeadphones,
faYoutube, faYoutube,
faOdysee,
faRss, faRss,
faChevronLeft, faChevronLeft,
faLevelDownAlt, faLevelDownAlt,