locked
media player detect script RRS feed

  • Question

  • I am trying to write a script that will auto detect windows media player. For example,

    If the user has 6.4 or greater, they will be re-directed to pageone.asp

    If they have less than 6.4 they will be re-directed to page2. asp

    How can I accomplish this?
    Thursday, June 7, 2007 8:34 AM

Answers

  • Here is a javascript that detects Windows Media Player and its version.

    *OBJECT classid=CLSID:22d6f312-b0f6-11d0-94ab-0080c74c7e95
    codeBase=#Version=6,4,5,715 height=1 id=WMP64 width=1|*/OBJECT|
    *OBJECT classid=CLSID:6BF52A52-394A-11d3-B153-00C04F79FAA6
    codeBase=#Version=7,0,0,1954 height=1 id=WMP7 width=1|*/OBJECT|
    *SCRIPT language=VBScript|
    *!--
    On Error Resume Next
    WB_DWM52 = (IsObject(CreateObject("MediaPlayer.MediaPlayer.1")))
    WB_DWM64 = (WMP64.filename = "")
    WB_DWM79 = WMP7.versionInfo
    //--|
    */SCRIPT|
    *SCRIPT language=JavaScript|
    *!--
    var WB_WM="undefined";
    if( WB_DWM79 ) {WB_WM=WB_DWM79.slice(0,3);}
    else if( WB_DWM64 ) {WB_WM="6.4";}
    else if( WB_DWM52 ) {WB_WM="5.2";}
    else {WB_WM="undefined";}
    document.write("Windows Media Player:" + WB_WM);
    //--|
    */SCRIPT|

    Thursday, June 7, 2007 8:35 AM

All replies

  • Here is a javascript that detects Windows Media Player and its version.

    *OBJECT classid=CLSID:22d6f312-b0f6-11d0-94ab-0080c74c7e95
    codeBase=#Version=6,4,5,715 height=1 id=WMP64 width=1|*/OBJECT|
    *OBJECT classid=CLSID:6BF52A52-394A-11d3-B153-00C04F79FAA6
    codeBase=#Version=7,0,0,1954 height=1 id=WMP7 width=1|*/OBJECT|
    *SCRIPT language=VBScript|
    *!--
    On Error Resume Next
    WB_DWM52 = (IsObject(CreateObject("MediaPlayer.MediaPlayer.1")))
    WB_DWM64 = (WMP64.filename = "")
    WB_DWM79 = WMP7.versionInfo
    //--|
    */SCRIPT|
    *SCRIPT language=JavaScript|
    *!--
    var WB_WM="undefined";
    if( WB_DWM79 ) {WB_WM=WB_DWM79.slice(0,3);}
    else if( WB_DWM64 ) {WB_WM="6.4";}
    else if( WB_DWM52 ) {WB_WM="5.2";}
    else {WB_WM="undefined";}
    document.write("Windows Media Player:" + WB_WM);
    //--|
    */SCRIPT|

    Thursday, June 7, 2007 8:35 AM
  • please let me know if it worked for u r not
    Saturday, June 9, 2007 5:14 AM
  • script lvar WB_DWM79; var WB_DWM64; var WB_DWM52 script

    before the vbscript else i'm getting a error.

    Saturday, January 22, 2011 5:31 AM