top | item 3905318

Show HN: Beatbar - Media player that beats in the browser address bar

147 points| jaip | 14 years ago |jaipandya.github.com | reply

43 comments

order
[+] nowarninglabel|14 years ago|reply
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.
[+] jaip|14 years ago|reply
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.
[+] mmahemoff|14 years ago|reply
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().

[+] jaip|14 years ago|reply
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.
[+] u4|14 years ago|reply
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.
[+] mansoor-s|14 years ago|reply
Very cool indeed, but the title should be more like "Media player that spams your browser's history DB"
[+] darklajid|14 years ago|reply
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.

History clean again.

[+] jaip|14 years ago|reply
Does it? I am doing a location.replace() which doesn't log the URL to history.
[+] flexd|14 years ago|reply
Cool idea! but not cool that it has completely filled my web browsing history, thanks.
[+] jaip|14 years ago|reply
Is it? For changing the window location I am doing a location.replace which doesn't log to the browser history. What browser are you on?
[+] hsb|14 years ago|reply
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.
[+] julioc|14 years ago|reply
You could use unicode for the controls. I modified the local code to use "‖" (and, due to a bug I guess, the chrome address bar became monospaced). If you need, check some reference on http://copypastecharacter.com/all-characters and http://graphemica.com/
[+] jaip|14 years ago|reply
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.
[+] badboy|14 years ago|reply
Awesome work. Just do me one favour: Add "return false" to the function bound to "space", otherwise the page scrolls when I hit it to pause.
[+] jaip|14 years ago|reply
Thanks, fixed.
[+] rhizome|14 years ago|reply
The reload button flashes like crazy.
[+] gghootch|14 years ago|reply
To my surprise, this worked perfectly on my iPhone...
[+] prezjordan|14 years ago|reply
Very cool! I think you're limited by the font - strangely enough. But this is very nice. Creative.
[+] jmonegro|14 years ago|reply
I'd argue you could boil ruby down from 'puts "hello world"' to just "hello world".
[+] fldrog|14 years ago|reply
Nice work:)

You could add the name of the artist/melody...

[+] jaip|14 years ago|reply
If there is a feature to be added, this is the one. On track. Thanks :)
[+] ss_ninja|14 years ago|reply
Great Job Jai!! Beatbar rocks!!
[+] vishus|14 years ago|reply
Awesome stuff Jai! Way to go!
[+] kefs|14 years ago|reply
thx for this. also, good use of comic sans.
[+] sohn|14 years ago|reply
Stupidity reachs new highs.