V
V
vspishka1242017-07-04 22:06:25
JavaScript
vspishka124, 2017-07-04 22:06:25

Sequential audio playback in html5?

There is such a code

<div class="audio">
                <audio id="player">
                    <source src="audio/Beliver.mp3"> 
                    <source src="audio/Radioactive.mp3"> 
                    <source src="audio/Polaroid.mp3"> 
                </audio>
                <div class="controls">
                    <img src='media/plauer/play.png' onclick="document.getElementById('player').play()">
                    <img src='media/plauer/pause.png' onclick="document.getElementById('player').pause()">
                    <div class="nameAudio">Beliver.mp3</div>
                    <img src='media/plauer/volume+.png' onclick="document.getElementById('player').volume+=0.1">
                    <img src='media/plauer/volume-.png' onclick="document.getElementById('player').volume-=0.1">
                </div>
            </div>

How can I make it so that when one audio recording finishes playing, the next one is played ???

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
SlavikF, 2017-07-04
@SlavikF

Multiple src's can be assigned to the same audio tag, giving the browser an alternative for choosing a format (eg mp3 or ogg for the same track). But not for sequential playback.
If you need to change the track at the end, then you need to do it according to JS events.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question