VueTube/NUXT/components/Player/watchtime.vue

32 lines
583 B
Vue
Raw Normal View History

2022-05-28 05:16:27 +00:00
<template>
<div
style="
left: 1.25rem;
bottom: 1.25rem;
font-size: 0.75rem;
position: absolute;
"
>
{{ watched }}
<span style="color: #999"> / {{ duration }} </span>
</div>
</template>
<script>
export default {
props: ["video"],
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>