Topic: Detect Flash

Hi,

I use the recent SimpleViewer Proversion.

It seems that if my page is opened bij a client with non (or maybe old version?) of flash, mij picters are shown in a kind of fullscreen mode without tumbs. This is verrry ugly and unusfull. I prefer to show in that case nothing or pont a user to a other normal html page.

For example, for shwing non flash-users:

"This site needs Flash, instal it, or goto http/:www.xyz123abc.com"

The question is how to do that?

I fond some code around here :

        <div id="flashcontent">SimpleViewer requires JavaScript and the Flash Player.
<a href="http://www.macromedia.com/go/getflashplayer/">Get Flash.</a></div>

But it seems not to work for the pro version.
Anny suggestions?

Thanks in advance.
Dirk

Re: Detect Flash

SimpleViewer v2.1 has been designed in such a way that if Flash is not detected (either not installed on a PC/Mac or not supported on a mobile device) then the viewer will fallback to using HTML5 in order to display the gallery.

Steven Speirs
SimpleViewer Support Team.

Re: Detect Flash

Thanks for your fast repley Steven.

Hopefulley the next upgrade wil support this, becouse, and to be honnest, this is a big isue.
The total disign of the website is blow awaw in a manner that it is a shame to show someone.
Its maybe a good idee to fall back to html but only if the result accepteble and look like what Flash does, or at least a bit can be manipulated by the desingner. In my case de 500 x 500 pics are so enlarged that they are unsharp, while scrolling in a large number of such large pics is terible, etc. I would prefer, and made your program more usefull,  to show nothing, and/or the possiblitity to point to a other (existing) html page.

Hopefully you can do someting with this critic couse the program is furter nice to use.

Thanks for your repley annyhow.
Dirk.

Re: Detect Flash

If you don't care about using the mobile code you can use the old embed method which supports flash detect.

http://www.simpleviewer.net/simpleviewe … ng.html#js
http://code.google.com/p/swfobject/

Mike Richards
SimpleViewer Support Team.

Re: Detect Flash

Of course you can!
Thanks, Mike.
Sorry, Dirk... not thinking straight this evening!

Steven Speirs
SimpleViewer Support Team.

Re: Detect Flash

Thanks for the answers!
But unfortunally this will not work for me becouse i dont want de simpleviewer logo on my site and there are less lay-out possibilities. Never the less i found mayby a other solution. Lightroom also generates some flas content (i fond Simpleviewer in lightroom also). The index page what Lightroom generate contains some code for detecting the flas-pluging AND contain  a IF/ELSE statement. What i did now is using that If/Else to redirext to a other page. This could by the index page of Simple viewer, Or a non flash page. I did test this and it works. First i start with that copied/changed code, and then it wil load the right page. Problebe this code contains a lot of things who are not needed. But i hardly understand what i am doing ;-)) Mayb this solution is for more people usefull. And if you think so, is there anny objection to do it in this whay??

Here is de code what did work: (sorry again for my poor English) (look for "Dirk" for what i did change )

<?xml version="1.0"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"[url]http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd[/url]">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Titel va wb</title>
<style type="text/css">
body,html {
margin-top:0;
margin-left:0;
margin-right:0;
margin-bottom:0;
height: 100%;
width: 100%;
}
</style>
<!-- Active Content Workaround Support File -->
<script src="resources/javascript/AC_RunActiveContent.js" type="text/javascript" ></script>
<script type="text/javascript">
<!--
function getQueryVariable(variable) {
  var query = window.location.search.substring(1);
  var vars = query.split("&");
  for (var i=0;i<vars.length;i++) {
    var pair = vars[i].split("=");
    if (pair[0] == variable) {
      return pair[1];
    }
  } 
  return -1;
}
// -->
</script>

<script type="text/javascript">
<!--
  var startImg = getQueryVariable("startImg");
  //alert(startImg);
// -->
</script> 

<!-- Flash Detection Script Block -->
<script type="text/javascript">
<!--
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
// Globals
// Major version of Flash required
var requiredMajorVersion = 8;
// Minor version of Flash required
var requiredMinorVersion = 0;
// Minor version of Flash required
var requiredRevision = 0;
// the version of javascript supported
var jsVersion = 1.0;
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
// -->
</script>
<script type="text/vbscript">
<!-- // Visual basic helper required to detect Flash Player ActiveX control version information
Function VBGetSwfVer(i)
  on error resume next
  Dim swControl, swVersion
  swVersion = 0
  
  set swControl = CreateObject("ShockwaveFlash.ShockwaveFlash." + CStr(i))
  if (IsObject(swControl)) then
    swVersion = swControl.GetVariable("$version")
  end if
  VBGetSwfVer = swVersion
End Function
// -->
</script>
<script type="text/javascript">
<!-- // Detect Client Browser type
var isIE  = (navigator.appVersion.indexOf("MSIE") != -1) ? true : false;
var isWin = (navigator.appVersion.toLowerCase().indexOf("win") != -1) ? true : false;
var isOpera = (navigator.userAgent.indexOf("Opera") != -1) ? true : false;
jsVersion = 1.1;
// JavaScript helper required to detect Flash Player PlugIn version information
function JSGetSwfVer(i){
    // NS/Opera version >= 3 check for Flash plugin in plugin array
    if (navigator.plugins != null && navigator.plugins.length > 0) {
        if (navigator.plugins["Shockwave Flash 2.0"] || navigator.plugins["Shockwave Flash"]) {
            var swVer2 = navigator.plugins["Shockwave Flash 2.0"] ? " 2.0" : "";
              var flashDescription = navigator.plugins["Shockwave Flash" + swVer2].description;
            descArray = flashDescription.split(" ");
            tempArrayMajor = descArray[2].split(".");
            versionMajor = tempArrayMajor[0];
            versionMinor = tempArrayMajor[1];
            if ( descArray[3] != "" ) {
                tempArrayMinor = descArray[3].split("r");
            } else {
                tempArrayMinor = descArray[4].split("r");
            }
              versionRevision = tempArrayMinor[1] > 0 ? tempArrayMinor[1] : 0;
            flashVer = versionMajor + "." + versionMinor + "." + versionRevision;
          } else {
            flashVer = -1;
        }
    }
    // MSN/WebTV 2.6 supports Flash 4
    else if (navigator.userAgent.toLowerCase().indexOf("webtv/2.6") != -1) flashVer = 4;
    // WebTV 2.5 supports Flash 3
    else if (navigator.userAgent.toLowerCase().indexOf("webtv/2.5") != -1) flashVer = 3;
    // older WebTV supports Flash 2
    else if (navigator.userAgent.toLowerCase().indexOf("webtv") != -1) flashVer = 2;
    // Can't detect in all other cases
    else {
        
        flashVer = -1;
    }
    return flashVer;
} 
// When called with reqMajorVer, reqMinorVer, reqRevision returns true if that version or greater is available
function DetectFlashVer(reqMajorVer, reqMinorVer, reqRevision) 
{
     reqVer = parseFloat(reqMajorVer + "." + reqRevision);
       // loop backwards through the versions until we find the newest version    
    for (i=25;i>0;i = i - 1) {    
        if (isIE && isWin && !isOpera) {
            versionStr = VBGetSwfVer(i);
        } else {
            versionStr = JSGetSwfVer(i);        
        }
        if (versionStr == -1 ) { 
            return false;
        } else if (versionStr != 0) {
            if(isIE && isWin && !isOpera) {
                tempArray         = versionStr.split(" ");
                tempString        = tempArray[1];
                versionArray      = tempString .split(",");                
            } else {
                versionArray      = versionStr.split(".");
            }
            versionMajor      = versionArray[0];
            versionMinor      = versionArray[1];
            versionRevision   = versionArray[2];
            
            versionString     = versionMajor + "." + versionRevision;   // 7.0r24 == 7.24
            versionNum        = parseFloat(versionString);
            // is the major.revision >= requested major.revision AND the minor version >= requested minor
            if ( (versionMajor > reqMajorVer) && (versionNum >= reqVer) ) {
                return true;
            } else {
                return ((versionNum >= reqVer && versionMinor >= reqMinorVer) ? true : false );    
            }
        }
    }    
}
// -->
</script>
</head>

<body>
<script type="text/javascript">
<!-- 
// Version check for the Flash Player that has the ability to start Player Product Install (6.0r65)
var hasProductInstall = DetectFlashVer(6, 0, 65);

// Version check based upon the values entered above in "Globals"
var hasReqestedVersion = DetectFlashVer(requiredMajorVersion, requiredMinorVersion, requiredRevision);

// Location visited after installation is complete if installation is required
var MMredirectURL = window.location;

// Stored value of document title used by the installation process to close the window that started the installation process
// This is necessary to remove browser windows that will still be utilizing the older version of the player after installation is complete
// DO NOT MODIFY THE FOLLOWING TWO LINES
//document.title = document.title.slice(0, 47) + " - Flash Player Installation";
document.title = document.title.slice(0, 47);
var MMdoctitle = document.title;



// Check to see if a player with Flash Product Install is available and the version does not meet the requirements for playback
if ( hasProductInstall && !hasReqestedVersion ) {
    var productInstallOETags = '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"'
    + 'width="550" height="100"'
    + 'codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab">'
    + '<param name="movie" value="resources/playerProductInstall.swf?MMredirectURL='+MMredirectURL+'&MMplayerType=ActiveX&MMdoctitle='+MMdoctitle+'" />'
    + '<param name="quality" value="best" /><param name="bgcolor" value="#3A6EA5" />'
    + '<embed src="resources/playerProductInstall.swf?MMredirectURL='+MMredirectURL+'&MMplayerType=PlugIn" quality="high" bgcolor="#3A6EA5" '
    + 'width="550" height="300" name="detectiontest" aligh="middle"'
    + 'play="true"'
    + 'loop="false"'
    + 'quality="best"'
    + 'allowScriptAccess="sameDomain"'
    + 'type="application/x-shockwave-flash"'
    + 'pluginspage="http://www.adobe.com/go/getflashplayer">'
    + '<\/embed>'
    + '<\/object>';
    document.write(productInstallOETags);   // embed the Flash Product Installation SWF
} else if (hasReqestedVersion) {  // if we've detected an acceptable version

        // DIRK: I REPLACED THE  ORIGINAL CODE  (WITCH DID OPEN SOME OTHER FLAS CONTENT) BY  (pointed to the index page of Simpleviewer pro)
        // (It would be nicer to insert here de code i found in the indeze page of Simpleviewer, but that dit not work.)
        
        
        self.location.href = "index.html";
        
        

  } else {  // flash is too old or we can't detect the plugin
  
     // DIRK: I DID REPLACE THE DISABLED CODE BY... (To point to a other NON Flash page/gallery
  
         self.location.href = "../GalHTML/index.html"
    
         // insert non-flash content
           // var alternateContent = 'This photo gallery requires the Adobe Flash Player.'
           //    + '<a href=http://www.adobe.com/go/getflash/>Get the free Flash Player here</a>';
          //  document.write(alternateContent); 
    

  }
// -->
</script>



<noscript>
    <!-- Provide alternate content for browsers that do not support scripting
         or for those that have scripting disabled. -->
    <p>
      Sorry, this photo gallery requires that scripting be enabled on your web browser and that the Adobe Flash Player be installed.
    <a href="http://www.adobe.com/go/getflash/">Download the Adobe Flash Player</a>
    </p>
</noscript>


</body>
</html>


Greetings, Dirk

Re: Detect Flash

Sorry for the repeated msgs!!
I did get several errors, so i thougt they were not inserted.

Re: Detect Flash

No worries!  I just deleted the duplicate posts.

I'm glad you've found a solution you're happy with, but just to clarify:

i dont want de simpleviewer logo on my site

If you were to use this method to embed the simpleviewer.swf file from the simpleviewer_pro_210/web/svcore/swf folder (from the Pro downlaod package), then the simpleviewer logo (text/link at bottom right hand corner) would not appear.

Steven Speirs
SimpleViewer Support Team.

Re: Detect Flash

I just purchased SimpleviewerPro and would prefer not to have the HTML5 option, preferring instead a page stating "Get Flash". The HTML5 fallback is not a suitable presentation for my high end jewelry.  Since it is not possible at this time to enable this option in Simple Viewer v2, can I send it back for an older Pro version that goes to the "Get Flash" page, for I can then also direct my viewers to a normal html gallery, too bad a very beautiful product otherwise.

Re: Detect Flash

If you want to disable the Mobile player you can use the old style embed code. There is an example of this code in the pro download folder at: examples/HTML_embed/local.html

Felix Turner
SimpleViewer Support Team.

Re: Detect Flash

Thank you Felix for the fast reply.  Can you give me some details in installing this code to make it function, thank you Laurel.

Re: Detect Flash

Hi,
Becouse I use the code I insert before, (with this code you can say what minimum Major version of Flash is required),
can you tell met please what te minimum version Simpleviewer pro needs??

Thanks in advance.
Dirk.

Re: Detect Flash

Becouse I use the code I insert before, (with this code you can say what minimum Major version of Flash is required), can you tell met please what te minimum version Simpleviewer pro needs??

9.0.124 (Major version 9, Minor version 0, Revision 124)

Steven Speirs
SimpleViewer Support Team.

Re: Detect Flash

Thanks Steven!!

I see just now that it also checks the minimum needed javascript version ( sorry)
I supose that is version 1.0 for Simpleviewer. Or is that of no importance??

Sorry for the extra question, just saw it later!

Dirk.

Re: Detect Flash

For the most part everyone has just about the same version of JavaScript, so you only need to test if it is enabled or not.

Mike Richards
SimpleViewer Support Team.

Re: Detect Flash

Hi,
Maybe some other people can use my work-around for avoiding that Simpleviewer pro  opens a HTML page if no (or no recent version) of Flash player is detected, and open instead of that your own non-flash page if needed or wanted.  I inserted the code before but I clean it up a little and removed some unneeded error-things. Therefore I inserted here a better version again.

How it works:
Instead of opening your Simpleviewer index page  you open first the page with the given code.
This code does some checking  about the existing of  Flash player, if this Flash Player Is detect and have the right version  then it automatic redirect (opens)  your Simpleviewer index page
If no right version of Flash player is installed then it automatic opens (redirect) to a other non-flash page of your choice.
It also checks or scripting in the browser is available and you can decide what to do then. (For example you can show a text to inform your users)

The only thing you have to do is to customize the given code where  it points to the Simpleviewer-index and alternate pages  so that de code can redirect to that pages on your website.  See therefore the comment in de code  under “CUSTOMIZE” . You find this, and have to chance it there,  on 4 locations.
If you want to see how it works, see:

www.dickpieter.nl (in Dutch)
www.dickpieter.com
www.dionpascalle.com
or
www.danielpartielle.com
(There are some problems what that last domain record, so maybe there could be a temporally error with that one, but that has nothing to do with this code.)

Anyhow, all links open the same website, but primarily with their one Simpleview gallery. If no Flash player is detected it shows a simplified mixed gallery HTML-page of my own.
If scripting is disabled in the browser its shows a msg.

Is there a drawback by using this method? So far I found one. Windows Explorers back-button does not work correct anymore. (if someone knows a solution for that I like to hear it :-). Firefox and Chrome having no problems with it. A little other problem is maybe that you have to understand my bad Englisch, haha.

As last thing to say:  be aware this is not a “official” solution,  and it is given how it is.
Good luck, and bug reports about my refrest Simpleviewer website are welcome :-)).

Dirk.

 

<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Check and Redirect page </title>
<style type="text/css">
body {
    background-color: #999999;
}
.style3 {color: #666666}
</style>


<script type="text/javascript">
<!--
function getQueryVariable(variable) {
  var query = window.location.search.substring(1);
  var vars = query.split("&");
  for (var i=0;i<vars.length;i++) {
    var pair = vars[i].split("=");
    if (pair[0] == variable) {
      return pair[1];
    }
  } 
  return -1;
}
// -->
</script>

<script type="text/javascript">
<!--
  var startImg = getQueryVariable("startImg");
  //alert(startImg);
// -->
</script> 

<!-- Flash Detection Script Block -->
<script type="text/javascript">
<!--
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
// Globals
// Major version of Flash required
var requiredMajorVersion = 9;
// Minor version of Flash required
var requiredMinorVersion = 0;
// Minor version of Flash required
var requiredRevision = 124;
// the version of javascript supported
var jsVersion = 1.0;
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
// -->
</script>
<script type="text/vbscript">
<!-- // Visual basic helper required to detect Flash Player ActiveX control version information
Function VBGetSwfVer(i)
  on error resume next
  Dim swControl, swVersion
  swVersion = 0
  
  set swControl = CreateObject("ShockwaveFlash.ShockwaveFlash." + CStr(i))
  if (IsObject(swControl)) then
    swVersion = swControl.GetVariable("$version")
  end if
  VBGetSwfVer = swVersion
End Function
// -->
</script>
<script type="text/javascript">
<!-- // Detect Client Browser type
var isIE  = (navigator.appVersion.indexOf("MSIE") != -1) ? true : false;
var isWin = (navigator.appVersion.toLowerCase().indexOf("win") != -1) ? true : false;
var isOpera = (navigator.userAgent.indexOf("Opera") != -1) ? true : false;
jsVersion = 1.1;
// JavaScript helper required to detect Flash Player PlugIn version information
function JSGetSwfVer(i){
    // NS/Opera version >= 3 check for Flash plugin in plugin array
    if (navigator.plugins != null && navigator.plugins.length > 0) {
        if (navigator.plugins["Shockwave Flash 2.0"] || navigator.plugins["Shockwave Flash"]) {
            var swVer2 = navigator.plugins["Shockwave Flash 2.0"] ? " 2.0" : "";
              var flashDescription = navigator.plugins["Shockwave Flash" + swVer2].description;
            descArray = flashDescription.split(" ");
            tempArrayMajor = descArray[2].split(".");
            versionMajor = tempArrayMajor[0];
            versionMinor = tempArrayMajor[1];
            if ( descArray[3] != "" ) {
                tempArrayMinor = descArray[3].split("r");
            } else {
                tempArrayMinor = descArray[4].split("r");
            }
              versionRevision = tempArrayMinor[1] > 0 ? tempArrayMinor[1] : 0;
            flashVer = versionMajor + "." + versionMinor + "." + versionRevision;
          } else {
            flashVer = -1;
        }
    }
    // MSN/WebTV 2.6 supports Flash 4
    else if (navigator.userAgent.toLowerCase().indexOf("webtv/2.6") != -1) flashVer = 4;
    // WebTV 2.5 supports Flash 3
    else if (navigator.userAgent.toLowerCase().indexOf("webtv/2.5") != -1) flashVer = 3;
    // older WebTV supports Flash 2
    else if (navigator.userAgent.toLowerCase().indexOf("webtv") != -1) flashVer = 2;
    // Can't detect in all other cases
    else {
        
        flashVer = -1;
    }
    return flashVer;
} 
// When called with reqMajorVer, reqMinorVer, reqRevision returns true if that version or greater is available
function DetectFlashVer(reqMajorVer, reqMinorVer, reqRevision) 
{
     reqVer = parseFloat(reqMajorVer + "." + reqRevision);
       // loop backwards through the versions until we find the newest version    
    for (i=25;i>0;i = i - 1) {    
        if (isIE && isWin && !isOpera) {
            versionStr = VBGetSwfVer(i);

        } else {
            versionStr = JSGetSwfVer(i);        
        }
        if (versionStr == -1 ) { 
            return false;
        } else if (versionStr != 0) {
            if(isIE && isWin && !isOpera) {
                tempArray         = versionStr.split(" ");
                tempString        = tempArray[1];
                versionArray      = tempString .split(",");                
            } else {
                versionArray      = versionStr.split(".");
            }
            versionMajor      = versionArray[0];
            versionMinor      = versionArray[1];
            versionRevision   = versionArray[2];
            
            versionString     = versionMajor + "." + versionRevision;   // 7.0r24 == 7.24
            versionNum        = parseFloat(versionString);
            // is the major.revision >= requested major.revision AND the minor version >= requested minor
            if ( (versionMajor > reqMajorVer) && (versionNum >= reqVer) ) {
                return true;
            } else {
                return ((versionNum >= reqVer && versionMinor >= reqMinorVer) ? true : false );    
            }
        }
    }    
}
// -->
</script>
</head>

<body>
<script type="text/javascript">
<!-- 
// Version check for the Flash Player that has the ability to start Player Product Install (6.0r65)
var hasProductInstall = DetectFlashVer(6, 0, 65);

// Version check based upon the values entered above in "Globals"
var hasReqestedVersion = DetectFlashVer(requiredMajorVersion, requiredMinorVersion, requiredRevision);

// Check to see if a player with Flash Product Install is available and the version does not meet the requirements for playback
if ( hasProductInstall && !hasReqestedVersion ) {
    var productInstallOETags = '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"'
    
//CUSTOMIZE!!!! Point here to your alternate non-flash Content page  (becouse there is no or not the right version of flash)
    
        self.location.href = "YourPath/YourAlterNateHTMlpage.html"

 
} else if (hasReqestedVersion) {  // if we've detected an acceptable version
        
//CUSTOMIZE!!!! Point here to your SimpleViewer index Page

        self.location.href = "PathToYourSimpleViewerpage/index.html";

  } else {  // flash is too old or we can't detect the plugin
   
     
//CUSTOMIZE!!!! Point here again to your alternate non-flash Content page 

    self.location.href = "YourPath/YourAlterNateHTMLindex.html"
    
     // insert non-flash content!
  }
// -->
</script>



<noscript>
    <!-- Provide alternate content for browsers that do not support scripting
         or for those that have scripting disabled. -->
<p>
      
 <!-- 
 //CUSTOMIZE! the text below if you like. This text will be show wen needed, but maybe you can point to an existing non-script AND non-flash page to. -->
  
  Sorry, the requested Gallery webpage requires that scripting be enabled on your web browser and that prefereble the Adobe Flash Player be installed. 
  As soon you enabled the scripting on your browser the Gallery pages are available. </p>

</noscript>

</body>

</html>

Re: Detect Flash

Hello Dirk,
I am trying your code for redirecting to a no flash page, works well on your site.  I installed the "check and redirect page" within the gallery folder in my site and inserted the “CUSTOMIZE” links to the pages.  Can't get it to work and would appreciate some advice.  Love your gallery site, Laurel Lee

Re: Detect Flash

Felix wrote:

If you want to disable the Mobile player you can use the old style embed code. There is an example of this code in the pro download folder at: examples/HTML_embed/local.html


Hello Felix,
I have tried using the HTML_embed/local.html old code in various and numerous ways, however when I publish any changes in the gallery it reverts back to HTML5.  I need some help with this and any advice would be appreciated.  Thank you Laurel Lee.

Re: Detect Flash

Hi Laural Lee,

If it works here, it must work overthere to i guess..

Whats is it thats not work then? What is happening whan you try to do what I describe?
Whitout further information the only thing i can gues is that you point under "customize" not to the right pages (maybe with the wrong syntax?) Further i can look to the by you costimized code, mayby i see what is wrong.

Whit other words; I would like to help you if i can, but be awere that i am more a artist then a programmer :-))

Dirk.

Re: Detect Flash

however when I publish any changes in the gallery it reverts back to HTML5.

When you publish from svBuilder it overwrites the specified HTML page. To keep your custom embed code, enter a different filename in the 'Index Page Name' field on the Publish panel.

Felix Turner
SimpleViewer Support Team.