P
P
Peter2012-12-25 06:23:06
JavaScript
Peter, 2012-12-25 06:23:06

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>


at the end writes that

[21:44:23.581] The "type" attribute specified for "audio/mpeg" is not supported. Failed to load media resource radio.sampo.ru/record.mp3 . @


How to be and what to do? Is it really possible to take a stream and start playing it on the client side?

Answer the question

In order to leave comments, you need to log in

4 answer(s)
E
Eddy_Em, 2012-12-25
@SeNaP

Should work. Only firefox mp3 does not support: you need to recode it in ogg.

H
hayk, 2012-12-25
@hayk

mp3 stream can be played with Flash. It's not HTML5, but a solution.

A
Anatol Pohorilyi, 2012-12-25
@decameron

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

A
Assorium, 2012-12-25
@Assorium

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>

But if you insert somewhere, then playback does not occur.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question