V
V
Vasya Ivanov2015-12-12 21:30:56
HTML
Vasya Ivanov, 2015-12-12 21:30:56

HTML5 broadcasting?

How to execute the button Stop radio stream under html5 player which has only Pause and Play. After all, after a pause, you start playback and the radio stream starts to sound from the moment at which the pause was made. But for listening to live radio, this is not convenient, you need a stop button or a play button that would start buffering the track again.

Answer the question

In order to leave comments, you need to log in

4 answer(s)
S
SagePtr, 2015-12-13
@vasyaivanovpv

I did this:
When you click on stop, change src to about:blank.
When you click on the play - change to the url of the radio stream.

O
Oleg Matrozov, 2015-12-12
@Mear

And if you change the src of the stream by adding a random parameter there when unpaused? Then, in fact, for the player it will be a new URL and this will cause the stream to be read from the server, and not from what it has already downloaded.

N
Nicholas, 2015-12-12
@healqq

You need to set the current time to the beginning of the track:

function stop(track) {
    track.pause();
    track.currentTime = 0;
}

E
Egor Tyuvaev, 2015-12-13
@CulHatsker

You can delete the player by the "stop" button, and by "start" you can create it again, or by "stop" you can simply turn off the sound, and by "start" - turn it on.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question