2020-04-17 06:23:28 +02:00
|
|
|
<template>
|
2022-02-19 06:39:14 +01:00
|
|
|
<a v-if="visible" :disabled="disabled" @click="seek">
|
2023-06-30 21:41:40 +02:00
|
|
|
<mdicon
|
|
|
|
name="fast-forward-30"
|
|
|
|
:size="icon_size"
|
|
|
|
:title="$t('player.button.seek-forward')"
|
|
|
|
/>
|
2020-04-17 06:23:28 +02:00
|
|
|
</a>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
|
|
|
import webapi from '@/webapi'
|
|
|
|
|
|
|
|
export default {
|
|
|
|
name: 'PlayerButtonSeekForward',
|
2022-04-16 10:14:03 +02:00
|
|
|
props: {
|
2024-02-28 13:10:08 +01:00
|
|
|
icon_size: { default: 16, type: Number },
|
|
|
|
seek_ms: { required: true, type: Number }
|
2022-04-16 10:14:03 +02:00
|
|
|
},
|
2020-04-17 06:23:28 +02:00
|
|
|
|
|
|
|
computed: {
|
2022-02-19 06:39:14 +01:00
|
|
|
disabled() {
|
|
|
|
return (
|
|
|
|
!this.$store.state.queue ||
|
|
|
|
this.$store.state.queue.count <= 0 ||
|
|
|
|
this.is_stopped ||
|
|
|
|
this.now_playing.data_kind === 'pipe'
|
|
|
|
)
|
2020-04-17 06:23:28 +02:00
|
|
|
},
|
2024-03-26 15:00:17 +01:00
|
|
|
is_stopped() {
|
|
|
|
return this.$store.state.player.state === 'stop'
|
|
|
|
},
|
|
|
|
now_playing() {
|
|
|
|
return this.$store.getters.now_playing
|
|
|
|
},
|
2022-02-19 06:39:14 +01:00
|
|
|
visible() {
|
2020-04-17 06:23:28 +02:00
|
|
|
return ['podcast', 'audiobook'].includes(this.now_playing.media_kind)
|
|
|
|
}
|
|
|
|
},
|
|
|
|
|
|
|
|
methods: {
|
2023-06-07 21:25:54 +02:00
|
|
|
seek() {
|
2020-04-17 06:23:28 +02:00
|
|
|
if (!this.disabled) {
|
|
|
|
webapi.player_seek(this.seek_ms)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
</script>
|