Audio and video set current Time is not working on Google Chrome

Viewed 120

I don't know why setting audio current time is not working on google chrome while it's working fine on other browsers.

Here is my code.

<template>
<div>
    <audio ref="audioRef" src="audio.mp3"></audio>
    <div style="width: 280px !important">
        <div class="my-1 px-0 mx-0">
            <v-slider
                dense
                height="15"
                @change="moveAudio"
                hide-details
                :value="playerProgress"
            ></v-slider>
        </div>
    </div>
</div>
<script>
export default {
    data() {
        return {
            playerProgress: 0,
        };
    },

    methods() {
        playPauseAudio() {
            const audio = this.$refs.audioRef;         
            audio.paused ? audio.play(); : audio.pause();           
        },
        moveAudio(value) {
            const audio = this.$refs.audioRef;
            this.playerProgress = value;
            audio.currentTime = value; // This part cause audio to restart in google chrome while in other browsers it's going to that time.
        },
    }
}
</script>

Thanks in advance.

0 Answers
Related