SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Enthusiast
    Join Date
    Feb 2002
    Location
    Newcastle Upon Tyne
    Posts
    53
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Flash 6 Detection?

    How would I use Javascript to detect Flash 6 player is on the user's computer. It has to be version 6.

    Thanks for your help,

    Graeme
    www.reebox.co.uk

  2. #2
    SitePoint Member
    Join Date
    Nov 2002
    Posts
    2
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Mook Flash Player Inspector

    You can download the Mook FPI which isnt that hard there is a javascript version HERE all zipped up. It is pretty straight forward on the site and in the zip file but if you have any problems I could help you configure it.

    Hope that helps

  3. #3
    SitePoint Enthusiast
    Join Date
    Nov 2002
    Posts
    51
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    This is my Flash sniffer which has been tested on Mac and PC. It's similar to Moocks, but it uses loops to optimse the code, and makes it easier to update when newer Flash plugins are available.

    Code:
    var VERSION_REQUIRED = 5; // Flash verion required
    var NO_FLASH_PAGE = 'noflash.html'; // No flash page
    var FLASH_MAX = 6; // The latest flash version
    
    
    var FLASH_VERSION = 0;
    var agent = navigator.userAgent.toLowerCase();
    if(navigator.plugins != null && navigator.plugins.length > 0){
    	var flashPlugin = navigator.plugins['Shockwave Flash'];
    	if(typeof flashPlugin == 'object'){
    		for(i=3; i<= FLASH_MAX; i++){
    			if(flashPlugin.description.indexOf(i+'.') != -1){
    				FLASH_VERSION = i;
    			}
    		}
    	}
    }
    else if(document.all && agent.indexOf('win')!=-1 && agent.indexOf('16bit')==-1){
    	document.write('<'+'script language="VBScript"'+'> \n');
    		document.write('set FlashObj = Nothing \n');
    		document.write('on error resume next \n');
    		document.write('For i = '+FLASH_MAX+' to 3 step -1 \n');
    			document.write('set FlashObj = CreateObject("ShockwaveFlash.ShockwaveFlash." & i) \n');
    			document.write('If (Not(FlashObj is Nothing)) Then \n');
    				document.write('FLASH_VERSION = i \n');
    				document.write('Exit For \n');
    			document.write('End If \n');
    		document.write('Next \n');
    	document.write('<'+'\/script'+'> \n');
    }
    else if (agent.indexOf('webtv/2.5') != -1){
    	FLASH_VERSION = 3;
    }
    else if (agent.indexOf('webtv') != -1){
    	FLASH_VERSION = 2;
    }
    else{
    	FLASH_VERSION = -1; // Cannot detect (Mac IE4.5)
    }
    if(FLASH_VERSION < VERSION_REQUIRED){
    		window.location.href = NO_FLASH_PAGE;
    }
    Last edited by podlob; Nov 13, 2002 at 20:03.
    travis


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •