If this doesn't work for anyone else, note that beatbar relies on soundcloud, and thus flash. I had flash blocked so was getting a javacript error because beatbar was undefined, enabled flash and it worked.
It uses soundManager for cross browser audio handling. It first tries with flash and fallbacks to html5 if flash is not available. Firefox with flash disabled wouldn't support mp3, and thus won't be able to play it. I am using SoundCloud api only to fetch streams.
Hmm, that's odd, I'm using Chrome 19.01 and have no other plugins running asides FlashBlock. Once I disabled flash block everything ran fine. Does this version of Chrome not support the HTML5 fallback?
I'm using Chrome 20.0.1116.0 (canary) with the plugins blocked by default (play on click) and I'm getting the same error. Also the usual 'run all plugins on this page' option is not there.
It doesn't seem to work in Safari with click2flash, either. Possibly because click2flash doesn't actually disable flash, it just requires a click -- but there's nothing to click on.
This is using the Ajax-era hash hack to change URL, which is causing problems with history and makes the reload button and favicon flash.
I'd suggest using HTML5 history, specifically replaceState(). It works on all modern browsers. Works on IE10, but not IE9 and below. If you want to support IE, you could fall back to the current location.replace().
I started with replaceState only, but later I realized there was no specific gain that I was having (other than slightly good looking string without hash). This method also suffers from reload and favicon flashes. If it reliably doesn't log to history (unlike location.replace()), using it could be a good idea. But that also comes with a tradeoff of older browser support issues, which requires using external javascript APIs.
I see. Surprised to learn there were still issues as replaceState() (as with pushState) is purely a transformation in the URL path. There's no reload and no update of the favicon link tag. Makes me wonder if that's a browser bug you saw.
every once in a while one bumps into something fairly useless(no disrespect) but insanely creative wow-&-smile-inducing piece of code here on HN. thanks for this. more power to you.
Since it took a minute to figure out how to clean that up, maybe this helps other Firefox users:
For me (vertical tabs) at least it was impossible to select multiple entries in the history (ctrl + h) with the mouse.
The workaround to remove the entries was to search for beatbar, tab into the list of entries, ctrl + a and right-click -> delete.
Thanks. It appears that location.replace doesn't work in a similar fashion on every browser. I am looking into other methods of implementing, but they look uglier.
This is the biggest "wow" I've seen in a long time for something that was otherwise completely useless. The ultimate definition of a hack. Absolutely awesome.
I settled with the standard character sets as I wasn't sure if the fancy unicode character would be available cross platform or not. I'll look for this possibility again. Thanks.