Rommel Rico: Random ramblings

Javascript for showing live StarCraft 2 streams, part 2.

In my last post, I posted some explanation about how to go about writing Javascript to dynamically add a StarCraft 2 stream and chat to my StarCraft 2 Mexican community forums, sc2mx.com. Well, it was a horrible mess of repeated code and the like, so I decided to clean it up a bit. Furthermore, older versions of Internet Explorer did not seem to want to display the streams. They just showed a white box where the stream was supposed to be. No code explanation this time, but here it is:

[CODE REMOVED DUE TO PROBLEMS WITH BROWSERS MISINTERPRETING THE CODE. SORRY.]

Note: I left the comments and script tags out because they were screwing up my blog post. Tips welcome in the comments below.

And this is how I called the script:
[CODE REMOVED DUE TO PROBLEMS WITH BROWSERS MISINTERPRETING THE CODE. SORRY.]

Again, this script will work with ustream, livestream, and justin.tv. Unfortunately, this STILL doesn’t work with old versions of Internet Explorer. I am stumped as to why this is the case, but I have a pretty good guess that it is a security issue. It does work with IE9 though, so if you are having troubles just update your browser. I also would like to advise people that this is a bad way of doing things. As your site grows, you will be making tons more API calls and you may run out resulting in an uneven experience.

Anyway, hope this is of use to someone. Let me know your thoughts and constructive criticism in the comments. I am always looking for ways to improve.

UPDATE: I had to remove the code because I was having browser issues with posting the javascript. Let me know if you know any workarounds.

You can follow any responses to this entry through the RSS 2.0 feed.