[web-src] skip fwd/back only for non url/pipe
This commit is contained in:
parent
cb6b1919a8
commit
45e7816637
|
@ -1,6 +1,11 @@
|
|||
<template>
|
||||
<a v-on:click="play_skip_back">
|
||||
<span class="icon"><i class="mdi mdi-replay"></i></span>
|
||||
<i v-if="is_skip_allowed">
|
||||
<span class="icon"><i class="mdi mdi-replay"></i></span>
|
||||
</i>
|
||||
<i v-else>
|
||||
<span class="icon has-text-grey-light"><i class="mdi mdi-replay"></i></span>
|
||||
</i>
|
||||
</a>
|
||||
</template>
|
||||
|
||||
|
@ -11,9 +16,15 @@ export default {
|
|||
name: 'PlayerButtonSkipBack',
|
||||
props: [ 'when_ms' ],
|
||||
|
||||
computed: {
|
||||
is_skip_allowed () {
|
||||
return this.$store.state.player.state !== 'stop' && this.$store.getters.now_playing && this.$store.getters.now_playing.data_kind !== 'url' && this.$store.getters.now_playing.data_kind !== 'pipe'
|
||||
}
|
||||
},
|
||||
|
||||
methods: {
|
||||
play_skip_back: function () {
|
||||
if (this.$store.state.player.state !== 'stop') {
|
||||
if (this.is_skip_allowed) {
|
||||
webapi.player_seek(this.when_ms - 10000)
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,6 +1,11 @@
|
|||
<template>
|
||||
<a v-on:click="play_skip_fwd">
|
||||
<span class="icon"><i class="mdi mdi-flip-h mdi-replay"></i></span>
|
||||
<i v-if="is_skip_allowed">
|
||||
<span class="icon"><i class="mdi mdi-flip-h mdi-replay"></i></span>
|
||||
</i>
|
||||
<i v-else>
|
||||
<span class="icon has-text-grey-light"><i class="mdi mdi-flip-h mdi-replay"></i></span>
|
||||
</i>
|
||||
</a>
|
||||
</template>
|
||||
|
||||
|
@ -11,9 +16,15 @@ export default {
|
|||
name: 'PlayerButtonSkipFwd',
|
||||
props: [ 'when_ms' ],
|
||||
|
||||
computed: {
|
||||
is_skip_allowed () {
|
||||
return this.$store.state.player.state !== 'stop' && this.$store.getters.now_playing && this.$store.getters.now_playing.data_kind !== 'url' && this.$store.getters.now_playing.data_kind !== 'pipe'
|
||||
}
|
||||
},
|
||||
|
||||
methods: {
|
||||
play_skip_fwd: function () {
|
||||
if (this.$store.state.player.state !== 'stop') {
|
||||
if (this.is_skip_allowed) {
|
||||
webapi.player_seek(this.when_ms + 10000)
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue