owntone-server/web-src/src/components/PlayerButtonSeekForward.vue
ejurgensen 8a177ed48d Revert "Merge branch 'master' of github.com:owntone/owntone-server"
This reverts commit bb2a778b46afca0fcd56bda6f02857fad78b14d8, reversing
changes made to f8e2298b677476f46eb67cc4331c18124f92a791.
2025-01-23 09:31:51 +01:00

61 lines
1.2 KiB
Vue

<template>
<a v-if="visible" :disabled="disabled" @click="seek">
<mdicon
name="fast-forward-30"
:size="icon_size"
:title="$t('player.button.seek-forward')"
/>
</a>
</template>
<script>
import { usePlayerStore } from '@/stores/player'
import { useQueueStore } from '@/stores/queue'
import webapi from '@/webapi'
export default {
name: 'PlayerButtonSeekForward',
props: {
icon_size: { default: 16, type: Number },
seek_ms: { required: true, type: Number }
},
setup() {
return {
playerStore: usePlayerStore(),
queueStore: useQueueStore()
}
},
computed: {
disabled() {
return (
this.queueStore?.count <= 0 ||
this.is_stopped ||
this.current.data_kind === 'pipe'
)
},
is_stopped() {
return this.player.state === 'stop'
},
current() {
return this.queueStore.current
},
player() {
return this.playerStore
},
visible() {
return ['podcast', 'audiobook'].includes(this.current.media_kind)
}
},
methods: {
seek() {
if (!this.disabled) {
webapi.player_seek(this.seek_ms)
}
}
}
}
</script>