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

33 lines
596 B
Vue
Raw Normal View History

2022-05-28 05:16:27 +00:00
<template>
<div
style="
2022-05-28 22:44:20 +00:00
color: #fff;
2022-05-29 22:14:00 +00:00
left: 1rem;
bottom: 1rem;
2022-05-28 05:16:27 +00:00
font-size: 0.75rem;
position: absolute;
"
>
{{ watched }}
<span style="color: #aaa"> / {{ duration }} </span>
2022-05-28 05:16:27 +00:00
</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>