Using WaveSurfer for a fancier audio player display #345
Loading…
Reference in a new issue
No description provided.
Delete branch "puniko/FoundKey:feature/wavesurfer-js"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Replaces the default audio player with wavesurfer (it still uses the default media element as backend to play the music)
Image attached shows the player. i tried to make it look similar to the module tracker
@ -13,4 +9,0 @@
:title="media.name"
controls
preload="metadata"
@volumechange="volumechange"
Please clean up references to
audioEl
and thevolumechange
function.@ -0,0 +4,4 @@
<div class="controls">
<button class="play" @click="playPause()">
<i class="fas fa-pause" v-if="playing"></i>
<i class="fas fa-play" v-if="!playing"></i>
@ -0,0 +13,4 @@
<span>
{{ formatTime(duration) }}
</span>
<input class="volume" type="range" min="0" max="1" step="0.1" v-model="volume" @change="player.setVolume(volume)" />
I think you should use
@input
instead of@change
because the latter only updates once you release the mouse.I would also prefer that kind of behaviour from the position progress thingy. Although it might make less sense there. Maybe pause while seeking? Thats what Firefox seems to do by default.
did the pause while seeking
@ -0,0 +37,4 @@
let isSeeking = ref(false);
let duration = ref(1);
let display = ref<HTMLDivElement>(null);
let player = ref(null);
Please use ref sugar (i.e.
$ref
) as mentioned in the contributing guide.@ -0,0 +44,4 @@
onMounted(() => {
player.value = WaveSurfer.create({
container: display.value,
barGab: 1,
I think this is a typo? The wavesurfer docs mention a
barGap
option instead.siehste, nicht nur du macht typos 🥴
@ -0,0 +86,4 @@
sec = '0' + sec;
}
if (min < 10) {
sec = '0' + min;
I think this should assign to
min
?@ -0,0 +88,4 @@
if (min < 10) {
sec = '0' + min;
}
return min + ':' + sec;
I think it should have an hour part too if the length is >= 1h.
not sure if i did the calculation correctly, but i doubt we gonna encounter the case of a track being longer than 1h super often, mostly because of upload limits of most instances and stuff
Thanks :3