repod/src/components/Player/ProgressBar.vue
Michel Roux 351bfd446c
All checks were successful
repod / nextcloud (push) Successful in 59s
repod / nodejs (push) Successful in 1m33s
Split components
2023-08-27 22:20:34 +02:00

38 lines
602 B
Vue

<template>
<div @click="(event) => audio.fastSeek(event.x * duration / event.target.offsetWidth)">
<NcProgressBar size="medium" :value="currentTime * 100 / duration" />
</div>
</template>
<script>
import { NcProgressBar } from '@nextcloud/vue'
export default {
name: 'ProgressBar',
components: {
NcProgressBar,
},
props: {
currentTime: {
type: Number,
required: true,
},
duration: {
type: Number,
required: true,
},
},
computed: {
audio() {
return document.getElementById('audio-player')
},
},
}
</script>
<style scoped>
div {
cursor: pointer;
}
</style>