Grooveshark’s new HTML5 web app was released with official support for Android and iPhone. Instantly, Windows Phone 7 owners complained that their platform was not supported. Last weekend, I began to look into WP7 and what changes were necessary to support the platform. Grooveshark doesn’t have any WP7 phones that I could use to test, so I used IE9 as the test platform. We were using the Zepto Javascript library for the mobile site. Zepto does not support IE9 because it uses __proto__ to extend objects, which is a hack especially for Webkit browsers, so I first attacked that and got IE9 working with the object extensions. Since the site appeared to work fine in IE9 so we announced that we now supported WP7 on Friday.

Oddly enough, I still read reports and emails of people saying that the site did not stream on their phone. I then began to debug more on the actual streaming. It seems that the AJAX calls we were making to our API were failing when they were requested over HTTPS. The Microsoft team states that it is a bug with IE8 that you cannot do AJAX calls through XDomainRequest to HTTPS pages from HTTP pages. They never bothered to fix it for IE9. The simple solution would be to just load the site in HTTPS and make all calls in HTTPS, however that is not possible right now, so I began to look for hacks to get around it. I tried making a Silverlight proxy but sadly, mobile Silverlight doesn’t support the HTML bridge needed for this. We only have 1 call to HTTPS on the site right now, but in the future, users will need to login and perform actions that require HTTPS, so this issue is quite the show-stopper.

The above issue aside, the audio tag on WP7 seemed to be making 2 requests to the audio URL and then wouldn’t play the song because the second request failed. Grooveshark does not allow a stream key to be used twice, so the second request will always fail. I spent 12 hours figuring out how to force WP7 to only make one request and in the end it came down to changing our stream endpoint from stream.php to stream.mp3. This is an easy change as we can just use a server-side rewrite to point stream.mp3 to stream.php.

In the end, we will not be supporting Windows Phone 7 until there is a solution for the HTTP<->HTTPS AJAX problem with IE9. Maybe with a future Windows Phone update the Internet Explorer team will finally fix the bug they acknowledged 2 years ago.

Please enable JavaScript to view the comments powered by Disqus.

Disqus