0
0
Fork 0
mirror of https://github.com/VueTubeApp/VueTube synced 2024-11-08 12:35:06 +00:00
VueTube/NUXT/components/Player/scrubber.vue

45 lines
697 B
Vue
Raw Normal View History

2022-03-30 12:32:08 +00:00
<template>
2022-03-30 16:57:49 +00:00
<div class="scrubber">
<div id="progress" class="primary" />
2022-03-30 12:32:08 +00:00
</div>
</template>
<script>
export default {
props: {
duration: {
type: Number,
default: 0,
},
endDuration: {
type: Number,
default: 0,
},
2022-03-30 12:32:08 +00:00
},
2022-03-30 16:57:49 +00:00
data() {
return {
percentage: 0,
};
},
mounted() {
const vm = this;
setInterval(function () {
vm.percentage = (vm.duration / vm.endDuration) * 100;
document.getElementById("progress").style.width = vm.percentage + "%";
}, 100);
},
};
2022-03-30 12:32:08 +00:00
</script>
<style scoped>
.scrubber {
width: 100%;
2022-03-30 16:57:49 +00:00
height: 5px;
background: rgba(255, 255, 255, 0.5);
}
#progress {
height: 100%;
2022-03-30 12:32:08 +00:00
}
</style>