View Full Version : HTML5 <audio>
ildaniel8
10th September 2011, 16:27
Hey Everybody i was making a new player in HTML5(using the <audio>) for a shoutcast server, and i managed to make it work on IE9 and Chrome (because of their support for mp3 files) but doesn't work in opera and firefox because they support only .ogg files.
Is it possible to stream mp3 and ogg files at the same time?
Unfortunately i do not have server passwords and i don't even know how it would be, i got asked to make a new webpage for it...
ildaniel8
11th September 2011, 12:12
Anyone?
DrO
12th September 2011, 09:54
this part of the forum isn't fast moving so it will take a while for people to (possibly) reply.
SHOUTcast won't stream in OGG (at least not in an officially support manner) and streaming the same content in multiple formats all depends on the station as to what version of the broadcasting tools are being used.
i don't know if there's a way to get an mp3 decoder in the other browsers (not seeing anything obvious at the moment) with most suggestions being to drop back to flash (which has issues of it's own for mp3 streams).
-daz
QOAL
12th September 2011, 10:26
Tada! http://jsmad.org/
:)
ildaniel8
15th September 2011, 14:54
Thanks QOAL, have you ever used this with a shoutcast server?
It has no documentation at all...(at least i can't find any other than the comments in the files)
QOAL
15th September 2011, 22:11
No, I haven't. I was just passing this part of the forum and saw the thread title and felt like having a look.
Your post made me remember seeing this [http://hacks.mozilla.org/2011/06/jsmad-a-javascript-mp3-decoder/], and I think it's the only pure JS solution for what you're trying to achieve.
As for documentation etc, it seems you're on your own there. (I'll assume that any documentation for libmad could be of help, as jsmad is a port of it.)
But yeah, it was just a passing "oh this could help!".
jaromanda
15th September 2011, 22:12
QOAL's link is interesting, but hardly useful, proof of concept at best. e.g. Switch to a different tab in firefox - stutters like a bastard.
DrO
15th September 2011, 22:28
But yeah, it was just a passing "oh this could help!".people doing things like that get them into trouble ;)
-daz
hackerdork
16th September 2011, 06:54
I have a working HTML5 player that works on IE9, Chrome , firefox, safari, iphone/ipad as well
http://indienation.fm/html5/
the jplayer I found falls back to flash if the browser doesn't support the <audio> tag.
player.php is a ugly player example but its plays the live stream running on sc_trans and sc_serv :)
all based on http://www.jplayer.org/
fyi if you look at the source code file you will notice I point to 8000/; as the ; seams to trick the player into working with shoutcast streams and not just local mp3 files
using stream.nsv; stream.hackerdork; something.file; all seem to work when it's the semicolon ';' that does this trick.
let me know if this works for you as well.
take care
DirtMcGirt
16th January 2012, 18:12
hackerdork, can you elaborate on your html5 code? I can't get my stream to play. It's an icecast stream, but I also have a shoutcast stream as a backup.
Bryon Stout
16th January 2012, 21:54
Maybe you can find some good info here
http://www.schillmania.com/projects/soundmanager2/
jackcr
1st June 2012, 17:30
<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Untitled Document</title>
</head>
<body>
<audio controls="controls" autoplay="autoplay" src="http://YOURSERVER.COM:YOURPORT/;stream.mp3">
</audio>
</body>
</html>
vBulletin® v3.8.6, Copyright ©2000-2013, Jelsoft Enterprises Ltd.