0
0
Fork 0
mirror of https://github.com/VueTubeApp/VueTube synced 2024-11-09 04:55:07 +00:00
VueTube/NUXT/components/Player/watchtime.vue

37 lines
732 B
Vue
Raw Normal View History

2022-05-28 05:16:27 +00:00
<template>
<div
2022-06-07 18:29:57 +00:00
style="color: #fff; left: 1rem; font-size: 0.75rem; position: absolute"
:style="fullscreen ? 'bottom: 4.25rem' : 'bottom: 1rem'"
2022-05-28 05:16:27 +00:00
>
{{ watched }}
<span style="color: #aaa"> / {{ duration }} </span>
2022-05-28 05:16:27 +00:00
</div>
</template>
<script>
export default {
2022-06-07 18:29:57 +00:00
props: {
video: {
type: Object,
required: true,
},
fullscreen: {
type: Boolean,
required: true,
},
},
2022-05-28 05:16:27 +00:00
data() {
return {
watched: 0,
duration: 0,
};
},
mounted() {
this.video.addEventListener("timeupdate", () => {
this.duration = this.$vuetube.humanTime(this.video.duration);
this.watched = this.$vuetube.humanTime(this.video.currentTime);
});
},
};
</script>