Thursday, November 3, 2011

Update: no more punishment for missing Flash

I just dumped an update on the stable channel. It fixes a pretty serious bug that triggered when you ran Stoffi without having Flash installed for Internet Explorer. If this was the case you would get pretty screwed. You would enter an endless loop of warnings that you do not have Flash installed (no mention that it HAD to be for Internet Explorer, Firefox is not good enough apparently).

We never meant to punish you for not having Flash for Internet Explorer installed. Really sorry about that to those affected.

For YouTube playback we use an embedded web browser. The browser in .NET runs Trident which is the core of Internet Explorer. As Google does not yet support embedded HTML5 players with a JavaScript exposed API, and Trident doesn't support HTML5 on YouTube, we are forced to use Flash.

The Problem
So Stoffi was supposed to stop and warn if no Flash was detected. However, this warning itself yelled "Stop!" to the media manager which at every "Stop!" tried to tell the YouTube player to stop. This caused a "no flash" error to occur again, and so the loop was created.

Unfortunately this happened when even as you tried to play a normal track not just a YouTube track (hence why the bug was so serious). A single warning (but no loop) was also triggered on startup which I found really annoying.

The Solution
First I made sure that the warning would only trigger directly after a Play action invoked by the user by double-clicking a track and I also made sure it would only occur once. After that I fixed the endless loop by putting in a number of checks around the media manager where it checks if Flash has been detected before it tries to talk to the YouTube player. Hopefully this will prevent similar or loops from happening.

Lastly, I modified the warning so it now explicitly mentions that it must be Flash for Internet Explorer. It also asks the user to download Flash and does so by opening up an instance of iexplore.exe and directs it to the website for getting Flash. My ambition would be to either move away from Flash fully and use HTML5 (which is hard since we need a new browser + support from Google) or bundle Flash with our installer (which may be hard because of licensing).

How To Upgrade
I just pushed out a new installer for those who doesn't have Stoffi already. For those of you who have Stoffi, it should upgrade automatically without any action needed to be taken on your part. If you have changed upgrade policy you may need take some action depending on the policy.

Special thanks to Thommy Siverman for finding and investigating this bug.