0
0
Fork 0
mirror of https://github.com/VueTubeApp/VueTube synced 2024-11-30 15:13:06 +00:00
VueTube/NUXT/components/Player/seekbar.vue
2022-05-20 22:02:15 -04:00

34 lines
638 B
Vue

<template>
<v-progress-linear
active
background-color="primary"
background-opacity="0.5"
:buffer-value="buffered"
color="primary"
height="3"
query
:value="percentage"
/>
</template>
<script>
export default {
props: ["video"],
data() {
return {
percentage: 0,
buffered: 0,
};
},
mounted() {
this.video.ontimeupdate = () => {
this.percentage = (this.video.currentTime / this.video.duration) * 100;
};
this.video.addEventListener("progress", () => {
this.buffered = (this.video.buffered.end(0) / this.video.duration) * 100;
});
},
};
</script>