style: 🎨 Seperate "video player" into its own component

This commit is contained in:
Front 2022-03-24 18:47:48 -04:00
parent f7187400f2
commit 24fc907b4c
2 changed files with 39 additions and 18 deletions

View File

@ -0,0 +1,38 @@
<template>
<div>
<video
controls
autoplay
:src="vidSrc"
width="100%"
@webkitfullscreenchange="handleFullscreenChange"
ref="player"
style="max-height: 50vh"
/>
</div>
</template>
<script>
export default {
props: [
"vidSrc"
],
methods: {
handleFullscreenChange() {
if (document.fullscreenElement === this.$refs.player) {
this.$vuetube.statusBar.hide();
this.$vuetube.navigationBar.hide();
} else {
this.$vuetube.statusBar.show();
this.$vuetube.navigationBar.show();
}
},
}
}
</script>

View File

@ -1,14 +1,6 @@
<template>
<div class="accent">
<video
controls
autoplay
:src="vidSrc"
width="100%"
@webkitfullscreenchange="handleFullscreenChange"
ref="player"
style="max-height: 50vh"
/>
<videoPlayer :vidSrc="vidSrc" />
<v-card v-if="loaded" class="ml-2 mr-2 accent" flat>
<v-card-title
class="mt-2"
@ -190,15 +182,6 @@ export default {
dialogTitle: "Share video",
});
},
handleFullscreenChange() {
if (document.fullscreenElement === this.$refs.player) {
this.$vuetube.statusBar.hide();
this.$vuetube.navigationBar.hide();
} else {
this.$vuetube.statusBar.show();
this.$vuetube.navigationBar.show();
}
},
},
watch: {
// Watch for change in the route query string (in this case, ?v=xxxxxxxx to ?v=yyyyyyyy)