Merge branch 'TeamPiped:master' into master

This commit is contained in:
kskarthik 2022-06-25 15:38:41 +05:30 committed by GitHub
commit 4f1a67cbe5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 89 additions and 43 deletions

View file

@ -14,7 +14,7 @@ An open-source alternative frontend for YouTube which is efficient by design.
YouTube has an extremely invasive privacy policy which relies on using user data in unethical ways. You give them a lot of data - ranging from ideas, music taste, content, political opinions, and much more than you think. YouTube has an extremely invasive privacy policy which relies on using user data in unethical ways. You give them a lot of data - ranging from ideas, music taste, content, political opinions, and much more than you think.
By using Piped, you can freely watch and listen to content freely without the fear of prying eyes watching everything you are doing. By using Piped, you can freely watch and listen to content without the fear of prying eyes watching everything you are doing.
## Features: ## Features:
@ -85,7 +85,7 @@ You can help by translating the project to a language you speak at https://hoste
- Stage your files `git add .` - Stage your files `git add .`
- Commit your changes `git commit -am 'Add awesome new feature'` - Commit your changes `git commit -am 'Add awesome new feature'`
- Push to the branch `git push origin my-awesome-feature` - Push to the branch `git push origin my-awesome-feature`
- Create a new pull request: https://github.com/TeamPiped/Piped-Redirects/compare - Create a new pull request: https://github.com/TeamPiped/Piped/compare
### Development Setup ### Development Setup

View file

@ -1,14 +1,32 @@
<template> <template>
<!-- <h2 v-t="'video.chapters'" class="mb-5" /> --> <!-- desktop view -->
<div class="flex overflow-x-auto"> <div v-if="!mobileLayout" class="flex-col overflow-y-scroll max-h-75vh min-h-64 <lg:hidden">
<div :key="chapter.start" v-for="chapter in chapters" @click="$emit('seek', chapter.start)" class="chapter"> <h2 v-t="'video.chapters'" class="mb-2 bg-gray-500/50 p-2" />
<img :src="chapter.image" :alt="chapter.title" class="" /> <div
<div class="m-1 flex"> :key="chapter.start"
v-for="chapter in chapters"
@click="$emit('seek', chapter.start)"
class="chapter-vertical"
>
<div class="flex">
<img :src="chapter.image" :alt="chapter.title" />
<div class="flex flex-col m-2">
<span class="text-truncate text-sm" :title="chapter.title" v-text="chapter.title" /> <span class="text-truncate text-sm" :title="chapter.title" v-text="chapter.title" />
<span class="text-sm font-bold text-blue-500" v-text="timeFormat(chapter.start)" /> <span class="text-sm font-bold text-blue-500" v-text="timeFormat(chapter.start)" />
</div> </div>
</div> </div>
</div> </div>
</div>
<!-- mobile view -->
<div v-else class="flex overflow-x-auto">
<div :key="chapter.start" v-for="chapter in chapters" @click="$emit('seek', chapter.start)" class="chapter">
<img :src="chapter.image" :alt="chapter.title" />
<div class="m-1 flex">
<span class="text-truncate text-sm" :title="chapter.title" v-text="chapter.title" />
<span class="px-1 text-sm font-bold text-blue-500" v-text="timeFormat(chapter.start)" />
</div>
</div>
</div>
</template> </template>
<style> <style>
@ -16,20 +34,22 @@
height: 5px; height: 5px;
} }
.chapter { .chapter {
@apply cursor-pointer; @apply cursor-pointer self-center p-2.5;
align-self: center;
padding: 10px;
img { img {
width: 100%; @apply w-full h-full;
height: 100%;
} }
} }
.chapter-vertical {
@apply cursor-pointer self-center p-2.5;
img {
@apply w-3/10 h-3/10;
}
}
.chapter-vertical:hover {
@apply bg-gray-500;
}
.text-truncate { .text-truncate {
white-space: nowrap; @apply truncate overflow-hidden inline-block w-10em;
width: 10em;
overflow: hidden;
text-overflow: ellipsis;
display: inline-block;
} }
</style> </style>
@ -38,6 +58,10 @@ import { defineProps, defineEmits } from "vue";
defineProps({ defineProps({
chapters: Object, chapters: Object,
mobileLayout: {
type: Boolean,
default: () => true,
},
}); });
defineEmits(["seek"]); defineEmits(["seek"]);

View file

@ -16,6 +16,7 @@
<ErrorHandler v-if="video && video.error" :message="video.message" :error="video.error" /> <ErrorHandler v-if="video && video.error" :message="video.message" :error="video.error" />
<div v-show="!video.error"> <div v-show="!video.error">
<div :class="isMobile ? 'flex-col' : 'flex'">
<VideoPlayer <VideoPlayer
ref="videoPlayer" ref="videoPlayer"
:video="video" :video="video"
@ -25,7 +26,13 @@
:selected-auto-play="selectedAutoPlay" :selected-auto-play="selectedAutoPlay"
:selected-auto-loop="selectedAutoLoop" :selected-auto-loop="selectedAutoLoop"
/> />
<ChaptersBar v-if="video?.chapters?.length > 0" :chapters="video.chapters" @seek="navigate" /> <ChaptersBar
:mobileLayout="isMobile"
v-if="video?.chapters?.length > 0"
:chapters="video.chapters"
@seek="navigate"
/>
</div>
<div class="font-bold mt-2 text-2xl break-words" v-text="video.title" /> <div class="font-bold mt-2 text-2xl break-words" v-text="video.title" />
<div class="flex mb-1.5"> <div class="flex mb-1.5">
@ -203,6 +210,7 @@ export default {
smallViewQuery: smallViewQuery, smallViewQuery: smallViewQuery,
smallView: smallViewQuery.matches, smallView: smallViewQuery.matches,
showModal: false, showModal: false,
isMobile: true,
}; };
}, },
computed: { computed: {
@ -226,6 +234,18 @@ export default {
}, },
}, },
mounted() { mounted() {
// check screen size
if (window.innerWidth >= 1024) {
this.isMobile = false;
}
// add an event listener to watch for screen size changes
window.addEventListener("resize", () => {
if (window.innerWidth >= 1024) {
this.isMobile = false;
} else {
this.isMobile = true;
}
});
this.getVideoData().then(() => { this.getVideoData().then(() => {
(async () => { (async () => {
const videoId = this.getVideoId(); const videoId = this.getVideoId();

View file

@ -21,9 +21,9 @@
"back": "Zpět", "back": "Zpět",
"uses_api_from": "Používá API od ", "uses_api_from": "Používá API od ",
"enable_sponsorblock": "Zapnout Sponsorblock", "enable_sponsorblock": "Zapnout Sponsorblock",
"skip_intro": "Přeskočit přestávku/úvodní animaci", "skip_intro": "Přeskočit přestávku / úvodní animaci",
"skip_preview": "Přeskočit Náhled/Shrnutí", "skip_preview": "Přeskočit náhled / shrnutí",
"skip_interaction": "Přeskočit připomenutí interakce (odebírat)", "skip_interaction": "Přeskočit připomenutí interakce (odběr)",
"dark": "Tmavý", "dark": "Tmavý",
"light": "Světlý", "light": "Světlý",
"autoplay_video": "Automatické přehrávání videa", "autoplay_video": "Automatické přehrávání videa",
@ -31,13 +31,13 @@
"default_quality": "Výchozí kvalita", "default_quality": "Výchozí kvalita",
"buffering_goal": "Ukládání do vyrovnávací paměti (v sekundách)", "buffering_goal": "Ukládání do vyrovnávací paměti (v sekundách)",
"country_selection": "Výběr země", "country_selection": "Výběr země",
"default_homepage": "Výchozí Domovská stránka", "default_homepage": "Výchozí domovská stránka",
"show_comments": "Zobrazit komentáře", "show_comments": "Zobrazit komentáře",
"minimize_description_default": "Automaticky minimalizovat popis", "minimize_description_default": "Automaticky minimalizovat popis",
"store_watch_history": "Uložit historii sledování", "store_watch_history": "Uložit historii sledování",
"language_selection": "Výběr jazyka", "language_selection": "Výběr jazyka",
"instances_list": "Seznam instancí", "instances_list": "Seznam instancí",
"enabled_codecs": "Povolené kodeky (Více)", "enabled_codecs": "Povolené kodeky (několik)",
"instance_selection": "Výběr instance", "instance_selection": "Výběr instance",
"show_more": "Zobrazit více", "show_more": "Zobrazit více",
"yes": "Ano", "yes": "Ano",
@ -46,9 +46,9 @@
"import_from_json": "Importovat z JSON", "import_from_json": "Importovat z JSON",
"auto_play_next_video": "Automaticky přehrát další video", "auto_play_next_video": "Automaticky přehrát další video",
"donations": "Darovat", "donations": "Darovat",
"show_description": "Ukázat popis", "show_description": "Zobrazit popis",
"minimize_recommendations": "Minimalizovat doporučení", "minimize_recommendations": "Skrýt doporučení",
"skip_outro": "Přeskočit Doporučená videa/Závěrečné titulky", "skip_outro": "Přeskočit koncové karty / titulky",
"auto": "Auto", "auto": "Auto",
"show_recommendations": "Zobrazit doporučení", "show_recommendations": "Zobrazit doporučení",
"disable_lbry": "Zakázat LBRY pro streamování", "disable_lbry": "Zakázat LBRY pro streamování",
@ -63,20 +63,21 @@
"load_more_replies": "Načíst další odpovědi", "load_more_replies": "Načíst další odpovědi",
"unsubscribe": "Zrušit odběr - {count}", "unsubscribe": "Zrušit odběr - {count}",
"skip_sponsors": "Přeskočit sponzory", "skip_sponsors": "Přeskočit sponzory",
"minimize_description": "Minimalizovat popis", "minimize_description": "Skrýt popis",
"skip_non_music": "Přeskočit Hudbu: Nehudební sekce", "skip_non_music": "Přeskočit hudbu: nehudební sekce",
"skip_self_promo": "Přeskočit Neplacenou/Vlastní propagaci", "skip_self_promo": "Přeskočit neplacenou / vlastní propagaci",
"theme": "Téma", "theme": "Téma",
"skip_highlight": "Přeskočit Highlight", "skip_highlight": "Přeskočit na zvýraznění",
"skip_filler_tangent": "Přeskočit výplňový obsah", "skip_filler_tangent": "Přeskočit výplňový obsah",
"add_to_playlist": "Přidat do playlistu", "add_to_playlist": "Přidat do playlistu",
"remove_from_playlist": "Odstranit z playlistu", "remove_from_playlist": "Odstranit z playlistu",
"delete_playlist_confirm": "Opravdu si přejete odstranit tento playlist?", "delete_playlist_confirm": "Opravdu si přejete odstranit tento playlist?",
"please_select_playlist": "Prosím vyberte playlist", "please_select_playlist": "Prosím vyberte playlist",
"create_playlist": "Vytvořit Playlist", "create_playlist": "Vytvořit playlist",
"delete_playlist": "Odstranit Playlist", "delete_playlist": "Odstranit playlist",
"select_playlist": "Vybrat Playlist", "select_playlist": "Vyberte playlist",
"delete_playlist_video_confirm": "Opravdu si přejete odstranit toto video z tohoto playlistu?" "delete_playlist_video_confirm": "Opravdu si přejete odstranit toto video z tohoto playlistu?",
"show_markers": "Zobrazit značky na přehrávači"
}, },
"player": { "player": {
"watch_on": "Sledovat na {0}" "watch_on": "Sledovat na {0}"

View file

@ -89,7 +89,8 @@
"videos": "Video", "videos": "Video",
"ratings_disabled": "Valutazioni disabilitate", "ratings_disabled": "Valutazioni disabilitate",
"live": "{0} Diretta", "live": "{0} Diretta",
"chapters": "Capitoli" "chapters": "Capitoli",
"shorts": "Shorts"
}, },
"preferences": { "preferences": {
"ssl_score": "Valutazione SSL", "ssl_score": "Valutazione SSL",