« Magnatune mostly working now | Main | Pinterest and Magnatune »

November 25, 2013



You should use feature detection and not user agent sniffing to detect what audio files can be played. Maybe even Firefox can play AAC when it uses DirectShow filters/QuickTime? I think it does this now at least for h264, or doesn't it? I use Linux.

See HTMLMediaElement.prototype.canPlayType here: https://developer.mozilla.org/en-US/docs/Web/API/HTMLMediaElement

Alternatively you just could define a fallback list of source elements and let the browser choose the first one it understands:

The second option is what I use in http://greattuneplayer.jit.su/

"every time a song plays, the URL on the page will change to have a song= on the end of it"

This does not seem to work for me in Chrome 27. Works in Firefox 25.0.1 though. Do you use history.pushState for this? This should work in Chrome.

Spike Page

You mentioned in IE6 that the tabs URL does not change. In addition to that, I am finding that on some (but not all) albums, when I switch tabs, not only does the URL remain the same, but the page content does not change. This is kind of a bummer since I have been using IE6 to listen due to the fact that Firefox still requires me to load the entire song before any music will play in browser.


Just discovered another interesting glitch that occurs on both IE and FF. When I share a song or album to Facebook from the Share tab, it posts the artist blurb rather than the album blurb, which is why I prefer sharing by posting a link to the Album Info tab page. But when I do that now, rather than display the album blurb as before, that text is replaced by a copy of whatever text I add to my Facebook status update. My current workaround is just to copy and paste the album blurb into my FB status update field, but it seems there's something wonky going on in a script somewhere.

John from Magnatune

Panzi: I had been automatically using OGG for Firefox, because that browser had always supported it, but now, I do as you suggest, and only send OGG audio if the browser says it supports it, since IE changed their browser string to look just like Firefox.

As to the song= it's odd that Chrome 27 doesn't support it. It does work in Chrome 31, which I'm I'm using history.replaceState for that feature, as I don't want to add to the history every time you click a tab (back arrow in the browser then becomes annoying)

John from Magnatune

re: facebook -- thanks for the tip, I know what it takes to fix the facebook problem and will do this weekend.


Jared Rimer

This doesn't work. Taken from the member page http://download.magnatune.com/artists/albums/charlieb-transport?song=1 if I change the 1 to a 2, it takes me to the download page. All the albums seem to take me to the album page, and don't play unless I go to album info, and select song 1 which is accesible. At least I can select a song, not necessarily 1, to start with to play.

Jared Rimer

Also, I notice that when in this mode, I can't go back to the previous page using firefox, for example, I selected damsel down to preview, selected the first CD, had to select album view, then the first song. Going back a page took me to the download page, have to go to download page for artists all over again.

John from Magnatune

re: Jared download page bug - thanks for pointing out the "download tab" bug, which I've now fixed. I've also added the "link to a tab" feature for the artists page now.

re: Jared firefox back arrow problem - I think that's fixed too now, as I think bug was related to the tab bug fixed above. If it's not, let me know a bit more about what pages you visit to cause the bug. It's working for me on Firefox.

re: facebook - descriptions and album art should post correctly to facebook now


I clicked on an album under http://magnatune.com/brief (jazz tab) and for some reason it suddenly scrolled to the bottom of the page and displayed a html5 audio element there. I opened the JavaScript console in this screenshot, maybe there is helpful information displayed to debug this:

John from Magnatune

Hi Panzi -- this can happen if you click the audio play button very quickly after the page loads, and the HTML5 audio engine hasn't yet loaded (it loads asynchronously). Currently, this causes it to think that you don't have HTML5 audio support, and so it moves into "IE6" compatibility mode and plays the audio using an embed tag.

The comments to this entry are closed.