repod/src/components/Player/ProgressBar.vue

35 lines
567 B
Vue
Raw Normal View History

2023-08-27 20:20:34 +00:00
<template>
<input
class="progress"
:max="duration"
min="0"
type="range"
:value="currentTime"
@change="(event) => seek(event.target.value)" />
2023-08-27 20:20:34 +00:00
</template>
<script>
import { mapActions, mapState } from 'pinia'
import { usePlayer } from '../../store/player.js'
2023-08-27 20:20:34 +00:00
export default {
name: 'ProgressBar',
computed: {
...mapState(usePlayer, ['duration', 'currentTime']),
},
methods: {
...mapActions(usePlayer, ['seek']),
2023-08-27 20:20:34 +00:00
},
}
</script>
<style scoped>
.progress {
height: 4px;
min-height: 4px;
position: absolute;
top: -2px;
width: 99%;
}
2023-08-27 20:20:34 +00:00
</style>