0
0
Fork 0
mirror of https://github.com/VueTubeApp/VueTube synced 2024-11-19 01:35:14 +00:00

feat: beta player stuff

This commit is contained in:
Front 2022-05-01 12:42:26 -04:00
parent 2a781b9e6b
commit 08f8a5de86
3 changed files with 81 additions and 7 deletions

View file

@ -0,0 +1,47 @@
<template>
<div>
<v-btn class="centerVideoControls" @click="togglePlaying()">
<v-icon v-text="playing ? 'mdi-pause' : 'mdi-play' " ref="pausePlayIndicator" />
</v-btn>
</div>
</template>
<style scoped>
.centerVideoControls {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
}
</style>
<script>
export default {
props: ["video"],
data() {
return {
playing: true,
}
},
methods: {
togglePlaying() {
if (this.video.paused) {
this.video.play()
this.playing = true;
} else {
this.video.pause()
this.playing = false;
}
}
}
}
</script>

View file

@ -1,8 +1,7 @@
<template> <template>
<div> <div style="position: relative;">
<video <video
ref="player" ref="player"
controls
autoplay autoplay
:src="vidSrc" :src="vidSrc"
width="100%" width="100%"
@ -10,18 +9,49 @@
@webkitfullscreenchange="handleFullscreenChange" @webkitfullscreenchange="handleFullscreenChange"
/> />
<seekbar :video=$refs.player v-if="$refs.player" /> <seekbar :video=$refs.player v-if="$refs.player" />
<!-- Video Controls -->
<div class="videoControls" v-if="$refs.player">
<div class="videoControlsWrap">
<controls :video=$refs.player />
</div>
</div>
<!-- End Video Controls -->
<!-- <v-slider v-model="value" step="0"></v-slider> --> <!-- <v-slider v-model="value" step="0"></v-slider> -->
{{ vidSrc }}
</div> </div>
</template> </template>
<style scoped>
.videoControls {
position: absolute;
width: 100%;
height: 100%;
top: 0;
}
.videoControlsWrap {
position: relative;
width: 100%;
height: 100%;
}
</style>
<script> <script>
import seekbar from '~/components/Player/seekbar.vue'; import seekbar from '~/components/Player/seekbar.vue';
import controls from '~/components/Player/controls.vue';
export default { export default {
props: ["sources"], props: ["sources"],
components: { components: {
seekbar seekbar,
controls
}, },
data() { data() {
return { return {

View file

@ -13,9 +13,6 @@
:value="percentage" :value="percentage"
/> />
{{ percentage }}
{{ buffered }}
</div> </div>
</template> </template>