Live data from Hacker News

JavaScript mp3 decoder allows Firefox to play mp3 without flash

jsmad.org

1–10 of 99 posts

Re: JavaScript mp3 decoder allows Firefox to play mp3 without flash

#4

jsmad lead developer here, shoot if you have any questions!

Here too, and please send us a tweet or so if you make something cool with it!

It seems to stutter if you change tabs, is this due to restrictions in Firefox background tabs and timers?

Edit: Awesome stuff, btw :D

Re: JavaScript mp3 decoder allows Firefox to play mp3 without flash

#7
post #4

Earlier quoted context omitted.

Here too, and please send us a tweet or so if you make something cool with it!

It seems to stutter if you change tabs, is this due to restrictions in Firefox background tabs and timers? Edit: Awesome stuff, btw :D

The stuttering when in a background tab we think is related to timers yes, but we hope that properly buffering the audio will fix it.

Re: JavaScript mp3 decoder allows Firefox to play mp3 without flash

#8

jsmad lead developer here, shoot if you have any questions!

Does anyone have a good handle on what the GPL means in the context of a javascript library invoked by an html page rendered by a browser? I certainly don't!

nb, you say: "libmad has commercial license. As for jsmad, we're in a sort of grey legal area." I presume you mean that you would have problems with a commercial licence? Your work is clearly a derivative work of libmad, so it has to be GPLv2 licensed: any commercial license would have to be by agreement with the libmad developers I think.

Regardless: very cool stuff!

Re: JavaScript mp3 decoder allows Firefox to play mp3 without flash

#9
post #4

Earlier quoted context omitted.

Here too, and please send us a tweet or so if you make something cool with it!

It seems to stutter if you change tabs, is this due to restrictions in Firefox background tabs and timers? Edit: Awesome stuff, btw :D

jsnockert's reply to this is dead for some reason:

---

jensnockert 3 minutes ago | link [dead]

The stuttering when in a background tab we think is related to timers yes, but we hope that properly buffering the audio will fix it.

-----

Re: JavaScript mp3 decoder allows Firefox to play mp3 without flash

#10
post #4

Earlier quoted context omitted.

Here too, and please send us a tweet or so if you make something cool with it!

It seems to stutter if you change tabs, is this due to restrictions in Firefox background tabs and timers? Edit: Awesome stuff, btw :D

The answer to this is complex, and I've spent the last night tuning the player so that it wouldn'd do that.

There are several scenarios here:

1) Either the MP3 data buffer doesn't fill fast enough (slow network transfer), so when it runs out of buffer, all hell breaks loose. This is because player.js is really naive, so more a demo bug than a jsmad bug.

2) Or Firefox fails to call the scheduled tasks (via setTimeout) for more than the length of a sound buffer, and then the audio device just stops. If the audio device stops updating for more than 500ms, player.js just resets the audio device and tries again.

3) And worst case: something goes really wrong, the rebuffer is called but audio is no longer being played. I have no idea what happens here, I'm laying the blame somewhere between Firefox 4 and audiolib.js (which is awesome btw).

So yeah, apparently browsers are really bad at scheduling CPU and IO-intensive concurrent things. It shows when streaming a large file - been listening to 1h+ mixes, which works, but stutters a lot in the beginning.

Just giving the mozilla devs a good benchmark to optimize for :)

Post reply on HN