I just dropped ClickToFlash 1.5.4 which fixes YouTube’s “Old Flash? Go upgrade!” message in the 1.5 branch (it’s been long-fixed in the 1.6 branch).
With this release, both 1.5.4 and 1.6b8 now advertise their presence (and version) via Javascript. This is mostly to assist Mark Pilgram’s Flash Block Detector project.
To use ClickToFlash’s new feature, call the GetVariable() method on the plugin object with a '$ClickToFlashVersion' key, like so:
document.getElementById('myFlashObject').GetVariable('$ClickToFlashVersion'));
If you get back null from the call, that means you’re talking to the Flash plugin. Since it doesn’t understand the $ClickToFlashVersion key, it just returns nothing.
However, if you get back a string, it should be ClickToFlash’s version number (such as '1.5.4' or '1.6b8') and it indicates the user hasn’t clicked the flash box yet.
Tip: if you’re testing locally, GetVariable('$ClickToFlashVersion') will always return null since local files are whitelisted by default.