Results 1 to 3 of 3

Thread: quicktime and WMP detection problems

  1. #1
    Join Date
    Nov 2006
    Posts
    236
    Thanks
    4
    Thanked 1 Time in 1 Post

    Default quicktime and WMP detection problems

    I have two scripts one for Windows media player and one for Quicktime. the one for QT I can't seem to get to work. also I'm wondering why I can't call the function for WMP though the QT function.

    Code:
    </script>
    
    <!--WMP function-->
    
    <script language="JavaScript">
    function testForWMP(){
    var player; 
    var plugin; 
    var hasActiveX=false;
    
    try{ 
    if(window.ActiveXObject)
      {
        hasActiveX = true;
        player = new ActiveXObject("WMPlayer.OCX.7"); 
      }
      else if (window.GeckoActiveXObject)
      {
        hasActiveX = true;    
        player = new GeckoActiveXObject("WMPlayer.OCX.7");
      }  
      } catch(oError) { }
      try  {
      if(navigator.mimeTypes)
      {
        plugin = navigator.mimeTypes['application/x-mplayer2'].enabledPlugin; 
      } 
      }catch (oError) { }
    var message = "Your browser "+ (hasActiveX ? "does" : " does not") +" support ActiveX. \n";
    message +=  "The Windows Media Player ActiveX control is"+ ( player ? "" : " not") +" installed. \n";
    message += "The Windows Media Plugin "+ (plugin ? "is" : "is not") +" installed. \n";
    alert(message);	 
    }
    </script>
    
    </head>
    
    <body>
    
    <div id="video"> "Klick to start video"
    <img src="http://www.knallgrau.at/code/plugin_js/demo/video-embeding/img/skifoan.jpg" 
    width="352" height="288" alt="Preview image for video; Klick to start video." 
    
    longdesc="http://www.knallgrau.at/code/plugin_js/demo/video-embeding" /></a></div>
    
    <script type="text/javascript"><!-- 
    function startVideo() {
    	if (Plugin.isInstalled("QuickTime")) {
    	    var quickTime = Plugin.getInfo("QuickTime");
    		if (parseInt(quickTime.version) == 6 && 
    quickTime.version.indexOf("6.5") == 0 || parseInt(quickTime.version) >= 7) {alert("you have quicktime")
    			
    			return false;
    			}
    		
    		
    		}
    		
    		
    		} else {testForWMP()/*can't tell if this works*/
    			
    			return false;
    		}
    	}
    	return false;
    }
    // --></script>
    
    <!--javascript for second quticktime navigator-->
    
    <script language="Javascript">
    var haveqt = false;
        
    	 
    	 if (navigator.plugins) {
              for (i=0; i < navigator.plugins.length; i++ ) {
                   if (navigator.plugins[i].name.indexOf("QuickTime") >= 0)
                        { haveqt = true; }
    					if (haveqt==true)
    					{alert("you have qt")}
                }
            }
    // — >
    </script>

  2. #2
    Join Date
    Nov 2006
    Posts
    236
    Thanks
    4
    Thanked 1 Time in 1 Post

    Default

    do I need to show the site's I got the code off of

  3. #3
    Join Date
    Nov 2006
    Posts
    236
    Thanks
    4
    Thanked 1 Time in 1 Post

    Default

    http://www.streamingmedia.com/articl...584&page=2&c=4
    that one is for the windows media player


    http://www.knallgrau.at/code/plugin_js
    the demo video JS for quicktime.

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
  •