0
0
Fork 0
mirror of https://github.com/VueTubeApp/VueTube synced 2024-11-25 20:55:17 +00:00

Merge branch 'main' of https://github.com/Frontesque/VueTube into working

This commit is contained in:
Alex 2022-04-20 12:55:17 +12:00
commit 92729a4d96
7 changed files with 275 additions and 178 deletions

View file

@ -3,6 +3,11 @@
v-model="tabSelection" v-model="tabSelection"
shift shift
class="bottomNav py-4 transparent" class="bottomNav py-4 transparent"
:style="
$vuetify.theme.dark
? 'border-top: 1px solid var(--v-background-lighten1) !important;'
: 'border-top: 1px solid var(--v-background-darken1) !important;'
"
> >
<v-btn <v-btn
v-for="(item, i) in tabs" v-for="(item, i) in tabs"

View file

@ -1,21 +1,46 @@
<template> <template>
<div> <div>
<video <video
ref="player"
controls controls
autoplay autoplay
:src="vidSrc" :src="vidSrc"
width="100%" width="100%"
style="max-height: 50vh; display: block"
@webkitfullscreenchange="handleFullscreenChange" @webkitfullscreenchange="handleFullscreenChange"
ref="player"
style="max-height: 50vh"
/> />
<v-progress-linear
active
background-color="primary"
background-opacity="0.5"
:buffer-value="buffered"
color="primary"
height="3"
query
:value="percentage"
/>
<!-- <v-slider v-model="value" step="0"></v-slider> -->
</div> </div>
</template> </template>
<script> <script>
export default { export default {
props: ["vidSrc"], props: ["vidSrc"],
data() {
return {
percentage: 0,
buffered: 0,
};
},
mounted() {
let vid = this.$refs.player;
vid.ontimeupdate = () => {
this.percentage = (vid.currentTime / vid.duration) * 100;
};
vid.addEventListener("progress", () => {
this.buffered = (vid.buffered.end(0) / vid.duration) * 100;
});
},
methods: { methods: {
handleFullscreenChange() { handleFullscreenChange() {
if (document.fullscreenElement === this.$refs.player) { if (document.fullscreenElement === this.$refs.player) {

View file

@ -193,14 +193,15 @@ export default {
} }
.scroll-y { .scroll-y {
overflow-y: scroll !important; /* has to be scroll, not auto */ overflow-y: scroll !important;
/* has to be scroll, not auto */
overflow-x: hidden !important; overflow-x: hidden !important;
-webkit-overflow-scrolling: touch !important; -webkit-overflow-scrolling: touch !important;
} }
html, html,
body { body {
background: var(--v-background-base); background: var(--v-background-base);
overflow: hidden; /* overflow-x: hidden; */
} }
p, p,

View file

@ -34,9 +34,9 @@ export default {
}, },
}, },
data: { data: () => ({
loading: false, loading: false,
}, }),
methods: { methods: {
paginate() { paginate() {

View file

@ -60,7 +60,7 @@ export default {
}; };
</script> </script>
<style scoped> <style>
.container { .container {
display: block; display: block;
position: absolute; position: absolute;
@ -104,4 +104,26 @@ export default {
animation: fadein 0.5s ease 1 forwards; animation: fadein 0.5s ease 1 forwards;
} }
} }
/* page transition */
.slide-up-enter-active,
.slide-up-leave-active,
.slide-down-enter-active,
.slide-down-leave-active {
transition-duration: 0.1s;
transition-property: opacity, transform;
/* overflow: hidden; */
}
.slide-up-enter,
.slide-down-leave-active {
opacity: 0;
transform: translateY(3rem);
}
.slide-up-leave-active,
.slide-down-enter {
opacity: 0;
transform: translateY(-1rem);
}
</style> </style>

View file

@ -2,11 +2,43 @@
<div class="d-flex flex-column justify-end" style="min-height: 100%"> <div class="d-flex flex-column justify-end" style="min-height: 100%">
<v-card <v-card
flat flat
class="px-6 ma-4 mt-2 background" class="mb-4 background"
style="
transition-duration: 0.3s;
transition-property: border-radius;
overflow: hidden;
"
:style="{
borderRadius: `${roundTweak / 2}rem`,
margin: $store.state.tweaks.roundTweak > 0 ? '0 1rem' : '0',
}"
>
<div
v-for="item in list"
:key="item"
@click="list.pop(item)"
class="pa-4 mb-1 background text-center rounded-sm"
:class="$vuetify.theme.dark ? 'lighten-1' : 'darken-1'"
>
{{ item }}
</div>
<v-card-title
v-ripple
class="pa-4 background primary--text text--lighten-2 rounded-sm"
:class="$vuetify.theme.dark ? 'lighten-1' : 'darken-1'"
@click="list.push('x')"
>
+++++++++++++++++++++++++++++
</v-card-title>
</v-card>
<v-card
flat
class="px-6 background"
style="transition-duration: 0.3s; transition-property: border-radius" style="transition-duration: 0.3s; transition-property: border-radius"
:class="$vuetify.theme.dark ? 'lighten-1' : 'darken-1'" :class="$vuetify.theme.dark ? 'lighten-1' : 'darken-1'"
:style="{ :style="{
borderRadius: `${roundTweak / 2}rem`, borderRadius: `${roundTweak / 2}rem`,
margin: $store.state.tweaks.roundTweak > 0 ? '0 1rem' : '0',
}" }"
> >
<h3 class="mt-5">Rounded Corners</h3> <h3 class="mt-5">Rounded Corners</h3>
@ -42,6 +74,9 @@
<script> <script>
export default { export default {
data: () => ({
list: ["x", "x"],
}),
computed: { computed: {
roundTweak: { roundTweak: {
get() { get() {

View file

@ -1,16 +1,21 @@
<template> <template>
<div class="background" id="watch-body"> <div class="background" id="watch-body">
<div id="player-container"> <div id="player-container">
<!-- Stock Player --> <v-btn text style="position: fixed; z-index: 69420" to="home">
<videoPlayer <v-icon>mdi-chevron-down</v-icon>
:vid-src="vidSrc" </v-btn>
ref="player"
v-if="useBetaPlayer !== 'true'"
/>
<!-- VueTube Player V1 --> <!-- VueTube Player V1 -->
<vuetubePlayer :sources="sources" v-if="useBetaPlayer === 'true'" /> <vuetubePlayer :sources="sources" v-if="useBetaPlayer === 'true'" />
<!-- Stock Player -->
<videoPlayer
id="player"
ref="player"
v-touch="{ down: () => $router.push('/home') }"
class="background"
:vid-src="vidSrc"
/>
</div> </div>
<div <div
v-bind:class="{ v-bind:class="{
'overflow-y-auto': !showComments, 'overflow-y-auto': !showComments,
@ -18,175 +23,174 @@
}" }"
id="content-container" id="content-container"
> >
<v-card v-if="loaded" class="ml-2 mr-2 background" flat> <v-card v-if="loaded" class="ml-2 mr-2 background rounded-0" flat>
<v-card-title <div
class="mt-2" v-ripple
style=" class="d-flex justify-space-between align-start px-3 pt-3"
padding-top: 0; @click="showMore = !showMore"
padding-bottom: 0; >
font-size: 0.95rem; <div class="d-flex flex-column">
line-height: 1rem; <v-card-title
" class="pa-0"
v-text="video.title" style="font-size: 0.95rem; line-height: 1.15rem"
v-emoji v-text="video.title"
/> v-emoji
<v-card-text> />
<v-card-text
style="font-size: 0.75rem"
class="background--text pa-0"
:class="$vuetify.theme.dark ? 'text--lighten-4' : 'text--darken-4'"
>
<div style="margin-bottom: 1rem"> <div style="margin-bottom: 1rem">
<template <template
v-for="text in video.metadata.contents.find( v-for="text in video.metadata.contents.find(
(content) => content.slimVideoInformationRenderer (content) => content.slimVideoInformationRenderer
).slimVideoInformationRenderer.collapsedSubtitle.runs" ).slimVideoInformationRenderer.collapsedSubtitle.runs"
>{{ text.text }}</template >{{ text.text }}
> </template>
</div> </v-card-text>
</div>
<!-- Scrolling Div For Interactions ---> <v-icon class="ml-4" v-if="showMore">mdi-chevron-up</v-icon>
<div style="display: flex; margin-bottom: 1em"> <v-icon class="ml-4" v-else>mdi-chevron-down</v-icon>
<v-list-item </div>
v-for="(item, index) in interactions" <div class="d-flex">
:key="index" <v-btn
style="padding: 0; flex: 0 0 20%" v-for="(item, index) in interactions"
> :key="index"
<v-btn text
text fab
class="vertical-button" class="vertical-button ma-1"
style="padding: 0; margin: 0" elevation="0"
elevation="0" style="width: 4.2rem !important; height: 4.2rem !important"
:disabled="item.disabled" :disabled="item.disabled"
@click="callMethodByName(item.actionName)" @click="callMethodByName(item.actionName)"
> >
<v-icon v-text="item.icon" /> <v-icon v-text="item.icon" />
<div <div
class="mt-2" class="mt-2"
style="font-size: 0.66rem" style="font-size: 0.66rem"
v-text="item.value || item.name" v-text="item.value || item.name"
/> />
</v-btn> </v-btn>
</v-list-item> <!-- End Scrolling Div For Interactions --->
<!-- <hr /> -->
<v-spacer /> </div>
<v-btn text @click="showMore = !showMore"> <!-- <v-bottom-sheet
<v-icon v-if="showMore">mdi-chevron-up</v-icon> v-model="showMore"
<v-icon v-else>mdi-chevron-down</v-icon> color="background"
</v-btn> style="z-index: 9999999"
</div> >
<!-- End Scrolling Div For Interactions ---> <v-sheet style="padding: 12px">
<!-- <hr /> --> <v-btn block @click="showMore = !showMore"
</v-card-text> ><v-icon>mdi-chevron-down</v-icon></v-btn
<!-- <v-bottom-sheet ><br />
v-model="showMore"
color="background" <slim-video-description-renderer
style="z-index: 9999999" class="scroll-y"
> :render="video.renderedData.description"
<v-sheet style="padding: 12px"> />
<v-btn block @click="showMore = !showMore" </v-sheet>
><v-icon>mdi-chevron-down</v-icon></v-btn </v-bottom-sheet> -->
><br />
<!-- <v-bottom-sheet v-model="share" color="background" style="z-index: 9999999">
<slim-video-description-renderer <v-sheet style="padding: 1em">
class="scroll-y" <div class="scroll-y">
:render="video.renderedData.description" {{ response.renderedData.description }}
/> </div>
</v-sheet> </v-sheet>
</v-bottom-sheet> --> </v-bottom-sheet> -->
<!-- <v-bottom-sheet v-model="share" color="background" style="z-index: 9999999"> </v-card>
<v-sheet style="padding: 1em"> <v-divider />
<div class="scroll-y">
{{ response.renderedData.description }} <!-- Channel Bar -->
<div class="channel-container" v-if="loaded">
<v-card
class="channel-section background px-3 rounded-0"
:to="video.channelUrl"
>
<div id="details">
<div class="avatar-link mr-3">
<v-img class="avatar-thumbnail" :src="video.channelImg" />
</div>
<div class="channel-byline" v-emoji>
<div class="channel-name" v-text="video.channelName" />
<div
class="caption background--text"
:class="
$vuetify.theme.dark ? 'text--lighten-4' : 'text--darken-4'
"
v-text="video.channelSubs"
/>
</div>
</div>
<div
class="channel-buttons"
style="color: rgb(204, 0, 0); text-transform: uppercase"
>
subscribe
</div> </div>
</v-sheet>
</v-bottom-sheet> -->
</v-card> </v-card>
<v-divider /> <v-divider />
<!-- Channel Bar -->
<div class="channel-container" v-if="loaded">
<v-card class="channel-section background" :to="video.channelUrl">
<div id="details">
<div class="avatar-link mr-3">
<v-img class="avatar-thumbnail" :src="video.channelImg" />
</div>
<div class="channel-byline" v-emoji>
<div class="channel-name" v-text="video.channelName" />
<div
class="caption background--text"
:class="
$vuetify.theme.dark ? 'text--lighten-4' : 'text--darken-4'
"
v-text="video.channelSubs"
/>
</div>
</div>
<div
class="channel-buttons"
style="color: rgb(204, 0, 0); text-transform: uppercase"
>
subscribe
</div>
</v-card>
<v-divider />
</div>
<!-- Description -->
<div class="description-container" v-if="showMore">
<div class="scroll-y ma-4">
<slim-video-description-renderer
:render="video.renderedData.description"
/>
</div>
<v-divider />
</div>
<!-- Comments -->
<div class="comment-container" v-if="loaded && video.commentData">
<v-btn
class="background comment-renderer text-none"
@click="showComments = !showComments"
block
large
>
<v-text class="comment-count keep-spaces">
<template v-for="text in video.commentData.headerText.runs">
<template v-if="text.bold">
<strong :key="text.text">{{ text.text }}</strong>
</template>
<template v-else>{{ text.text }}</template>
</template>
</v-text>
<v-icon>mdi-unfold-more-horizontal</v-icon>
</v-btn>
<v-divider />
</div>
<swipeable-bottom-sheet
v-model="showComments"
hide-overlay
persistent
no-click-animation
attach="#content-container"
v-if="loaded && video.commentData"
>
<mainCommentRenderer
:continuation="video.commentContinuation"
:commentData="video.commentData"
v-model="showComments"
></mainCommentRenderer>
</swipeable-bottom-sheet>
<!-- <swipeable-bottom-sheet
:v-model="showComments"
style="z-index: 9999999"
></swipeable-bottom-sheet> -->
<!-- Related Videos -->
<div class="loaders" v-if="!loaded">
<v-skeleton-loader
type="list-item-two-line, actions, divider, list-item-avatar, divider, list-item-three-line"
/>
<vid-load-renderer :count="5" />
</div>
<item-section-renderer v-else :render="recommends" />
</div> </div>
<!-- Description -->
<div v-if="showMore">
<div class="scroll-y ma-4">
<slim-video-description-renderer
:render="video.renderedData.description"
/>
</div>
<v-divider />
</div>
<!-- Comments -->
<div
v-if="loaded && video.commentData"
@click="showComments = !showComments"
>
<v-card flat class="background comment-renderer">
<v-text class="comment-count keep-spaces">
<template v-for="text in video.commentData.headerText.runs">
<template v-if="text.bold">
<strong :key="text.text">{{ text.text }}</strong>
</template>
<template v-else>{{ text.text }}</template>
</template>
</v-text>
<v-icon v-if="showComments">mdi-unfold-less-horizontal</v-icon>
<v-icon v-else>mdi-unfold-more-horizontal</v-icon>
</v-card>
<v-divider />
</div>
<swipeable-bottom-sheet
v-model="showComments"
hide-overlay
persistent
no-click-animation
attach="#content-container"
v-if="loaded && video.commentData"
>
<mainCommentRenderer
:continuation="video.commentContinuation"
:commentData="video.commentData"
v-model="showComments"
></mainCommentRenderer>
</swipeable-bottom-sheet>
<!-- <swipeable-bottom-sheet
:v-model="showComments"
style="z-index: 9999999"
></swipeable-bottom-sheet> -->
<!-- Related Videos -->
<div class="loaders" v-if="!loaded">
<v-skeleton-loader
type="list-item-two-line, actions, divider, list-item-avatar, divider, list-item-three-line"
/>
<vid-load-renderer :count="5" />
</div>
<item-section-renderer v-else :render="recommends" />
</div> </div>
</template> </template>
@ -211,7 +215,12 @@ export default {
SwipeableBottomSheet, SwipeableBottomSheet,
mainCommentRenderer, mainCommentRenderer,
}, },
layout: "empty",
// transition(to) { // TODO: fix layout switching
// return to.name == "watch"
// ? { name: "slide-up", mode: "" }
// : { name: "slide-down", mode: "" };
// },
data: function () { data: function () {
return this.initializeState(); return this.initializeState();
}, },
@ -329,7 +338,6 @@ export default {
fmt: 243, fmt: 243,
rtn: Math.floor(Date.now() / 1000) - this.startTime, rtn: Math.floor(Date.now() / 1000) - this.startTime,
rt: Math.floor(Date.now() / 1000) - this.startTime, rt: Math.floor(Date.now() / 1000) - this.startTime,
fmt: 243,
muted: 0, muted: 0,
}, },
this.playbackTracking.videostatsPlaybackUrl.baseUrl this.playbackTracking.videostatsPlaybackUrl.baseUrl
@ -393,6 +401,7 @@ export default {
<style> <style>
#watch-body { #watch-body {
height: 100%; height: 100%;
max-height: 100vh;
overflow: hidden; overflow: hidden;
display: flex; display: flex;
flex-direction: column; flex-direction: column;