Answer the question
In order to leave comments, you need to log in
HTML5 audio and playback stream
There is a stream on the old site, an online radio site. Is it possible somehow to take the playback stream from there?
<audio id="player">
<source src="http://radio.sampo.ru/record.mp3" type="audio/mpeg">
</audio>
</div>
<button class="btn" onclick="document.getElementById('player').play()">Воспроизведение</button>
<button class="btn" onclick="document.getElementById('player').pause()">Пауза</button>
<button class="btn" onclick="document.getElementById('player').volume+=0.1">Громкость +</button>
<button class="btn" onclick="document.getElementById('player').volume-=0.1">Громкость -</button>
[21:44:23.581] The "type" attribute specified for "audio/mpeg" is not supported. Failed to load media resource radio.sampo.ru/record.mp3 . @
Answer the question
In order to leave comments, you need to log in
Should work. Only firefox mp3 does not support: you need to recode it in ogg.
If this is a commercial project, then you will have to use Flash or encode audio in OGG, if for yourself, you can simply check mp3 support and if it is not there, issue a notification.
Faced with a similar problem, the decision was made in favor of Flash, of course.
Pseudo-class-layer for choosing a player (Flash or HTML5) with the same set of methods, and a single class for rendering
Interesting. On a direct link , Chrome plays the stream. And reproduced in this form.
<video controls="" autoplay="" name="media">
<source src="http://radio.sampo.ru/record.mp3" type="audio/mpeg">
</video>
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question