Detecting Flash Version for JW Player in ShadowboxPosted on May 2nd, 2009 6 comments
I ran into a situation today where a client told me the video player I integrated into his custom website CMS wasn’t working on his computer. Naturally, I gave him the standard web developer response to any bug: “Well, it works fine on my computer…” After all, I successfully tested on Firefox 2, Firefox 3, IE6, IE7, Safari 3, Safari 4, Opera and Chrome on my MacBook Pro running Windows XP under Bootcamp.
After a little technical sleuthing, we narrowed the issue down to the Flash plug-in version. Mine was Flash version 10.0 -r22 while his was Flash version 9.x. An unanswered forum post about Flash version detection at the Shadowbox website, and a forum post at longtail video both describe the exact situation we were having, so I knew I wasn’t crazy.
Okay, so we needed to test for the Flash plug-in version before blindly serving up an .flv coded for Flash 10 to users with 9 or lower. Remembering that the “old school way” of hand-coding the object/embed tag properties for embedding the Flash player in a web page allowed you to edit the required minimum version your content needs.
<OBJECT classid="clasid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" WIDTH="432" HEIGHT="330" id="myMovieName" > <PARAM NAME="movie" VALUE="myMovieName.swf" /> <PARAM NAME="quality" VALUE="high" /> <PARAM NAME=bgcolor VALUE=#FFFFFF> <EMBED src="/flash/ myMovieName.swf" quality="high" bgcolor=#FFFFFF WIDTH="432" HEIGHT="330" NAME="myMovieName" ALIGN="" TYPE="application/x-shockwave-flash" PLUGINSPAGE="http://www.macromedia.com/go/getflashplayer"> </EMBED> </OBJECT>
flashVersion: The minimum Flash version required to play a flash movie (as a string). Defaults to "9.0.0"
Uploaded, tested, works. What this code actually does (for users with Flash 9.x and below) is causes the included SWFObject with ExpressInstall.swf to be displayed instead of your content, which seamlessly encourages your website visitor to upgrade their Flash plug-in. If you want more customizable control over the alternate content your user sees, you might want to look into the Flash Detection Kit at Adobe.
Don’t you love well-documented open-source software? What a treat it is when fantastically useful and free code is actually documented and works as expected. That’s the beauty of open source. As it turns out, if we weren’t using Shadowbox to display Flash video inside a gallery, here’s how you can do the same thing with the JW Player Support for FlashVars API, by using the client variable:
client (Flash MAC X,0,XXX,0): Version and platform of the Flash client plugin. Useful to check for e.g. MP4 playback or fullscreen capabilities.
Note this not the same thing as the JW Player API. You use that if you want to customize the JW Player itself, mostly from within Flash.
On a somewhat related note, while talking about this issue with the best Flash designer in Florida I work with frequently, he asked me if I had ever heard of Kewbee, the Browser Plug-in Switcher, which is a great way to run multiple Flash versions simultaneously on the same computer. I think I’ll give that a try to make online software browser testing even easier. Now who doesn’t want need that?
Great post. Bookmarked.
I found your site via yahoo thanks for the post. I will bookmark it for future reference. Thanks Webmaster Forum
On the new movie clip’s linkage property, pick to use it in Actionscript & ‘Export in First Frame’ must also be checked. Then, type in the package-class name of the UIComponent class you historicallyin the past created where it asks for & Actionscript class. Click OK, then right click on your movie clip in the library, & pick ‘Component Definition’. You also require to identify the package-class name here. One times you click OK, you can return to the component definition to see that the public inspectable methods are now obtainable for you to assign values by Flash’s Component Inspector, & Properties. You’ll also notice that the icon for the movie clip has changed to the icon for a component.
You are a very smart person!
Compared with other FLV players, Any FLV Player has another important function – Create web videos with an embedded player which can be played directly online. It integrates web video component which enables you to post video files aimed at your website or BLOG such as posting videos to MySpace with only some clicks. You should use the “Publish for Web” feature to easily integrate any video aimed at your web. playerflv.net
hey,Superb blog post dude! i’m Tired of using RSS feeds and do you use twitter?so i can follow you there:D.
PS:Have you thought putting video to this blog posts to keep the readers more interested?I think it works.Best wishes, Filiberto Gingles
Leave a reply