Fix #1215
This commit is contained in:
parent
34610670c6
commit
998bd02a05
|
@ -5,7 +5,7 @@ import VolumeControl from './VolumeControl.vue'
|
||||||
import TrackFavoriteIcon from '~/components/favorites/TrackFavoriteIcon.vue'
|
import TrackFavoriteIcon from '~/components/favorites/TrackFavoriteIcon.vue'
|
||||||
import TrackPlaylistIcon from '~/components/playlists/TrackPlaylistIcon.vue'
|
import TrackPlaylistIcon from '~/components/playlists/TrackPlaylistIcon.vue'
|
||||||
import onKeyboardShortcut from '~/composables/onKeyboardShortcut'
|
import onKeyboardShortcut from '~/composables/onKeyboardShortcut'
|
||||||
import { computed } from 'vue'
|
import { computed, ref } from 'vue'
|
||||||
import { useGettext } from 'vue3-gettext'
|
import { useGettext } from 'vue3-gettext'
|
||||||
import useQueue from '~/composables/audio/useQueue'
|
import useQueue from '~/composables/audio/useQueue'
|
||||||
import usePlayer from '~/composables/audio/usePlayer'
|
import usePlayer from '~/composables/audio/usePlayer'
|
||||||
|
@ -39,6 +39,7 @@ const {
|
||||||
durationFormatted,
|
durationFormatted,
|
||||||
currentTimeFormatted,
|
currentTimeFormatted,
|
||||||
bufferProgress,
|
bufferProgress,
|
||||||
|
duration,
|
||||||
toggleMute,
|
toggleMute,
|
||||||
seek,
|
seek,
|
||||||
togglePlayback,
|
togglePlayback,
|
||||||
|
@ -91,6 +92,12 @@ const setCurrentTime = (time: number) => {
|
||||||
const switchTab = () => {
|
const switchTab = () => {
|
||||||
store.commit('ui/queueFocused', store.state.ui.queueFocused === 'player' ? 'queue' : 'player')
|
store.commit('ui/queueFocused', store.state.ui.queueFocused === 'player' ? 'queue' : 'player')
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const progressBar = ref()
|
||||||
|
const touchProgress = (event: MouseEvent) => {
|
||||||
|
const time = ((event.clientX - (event.target as Element).getBoundingClientRect().left) / progressBar.value.offsetWidth) * duration.value
|
||||||
|
currentTime.value = time
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
|
@ -113,7 +120,9 @@ const switchTab = () => {
|
||||||
@click.prevent.stop="toggleMobilePlayer"
|
@click.prevent.stop="toggleMobilePlayer"
|
||||||
>
|
>
|
||||||
<div
|
<div
|
||||||
|
ref="progressBar"
|
||||||
:class="['ui', 'top attached', 'small', 'inverted', {'indicating': isLoadingAudio}, 'progress']"
|
:class="['ui', 'top attached', 'small', 'inverted', {'indicating': isLoadingAudio}, 'progress']"
|
||||||
|
@click.prevent.stop="touchProgress"
|
||||||
>
|
>
|
||||||
<div
|
<div
|
||||||
class="buffer bar"
|
class="buffer bar"
|
||||||
|
|
|
@ -3,10 +3,19 @@
|
||||||
z-index: 999999;
|
z-index: 999999;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
width: 100vw;
|
width: 100vw;
|
||||||
|
|
||||||
.ui.top.attached.progress {
|
.ui.top.attached.progress {
|
||||||
top: 0;
|
top: 0;
|
||||||
|
height: 1rem;
|
||||||
|
z-index: 1;
|
||||||
|
padding-bottom: 0.8rem;
|
||||||
|
|
||||||
|
.bar {
|
||||||
|
height: 0.2rem;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
}
|
||||||
.ui.bottom-player > .segment.fixed-controls {
|
.ui.bottom-player > .segment.fixed-controls {
|
||||||
color: var(--player-color);
|
color: var(--player-color);
|
||||||
background: var(--player-background);
|
background: var(--player-background);
|
||||||
|
|
Loading…
Reference in New Issue