Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 8 of 8
  1. #1
    New to the CF scene
    Join Date
    Mar 2005
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Windows Media Player in FireFox help!

    I've been working on this script for the past week and it works great in IE and NS, but doesnt work in Firefox or Opera. Can you give the script a look over and tell me what i've been doing wrong. Thanks a bunch.

    <SCRIPT LANGUAGE="JavaScript">
    <!-- Begin
    var playstate = 1;
    shuffle = 0; // set to 0 to always play first video in list
    // set to 1 to randomly choose the first video to play
    videos=new Array();
    videos[0]="archive/DSUEP1.wmv";
    videos[1]="archive/DSR.EP2.wmv";
    videos[2]="archive/DSR.EP3.wmv";
    videos[3]="archive/DSR.EP4.wmv";
    videos[4]="archive/DSR.EP5.wmv";
    if (shuffle == 1) {
    var randsg = Math.floor(Math.random()*videos.length);
    document.dsrmotion.FileName = videos[randsg];
    document.dsrmotion.scr = videos[randsg];
    document.forms['form'].playlist.options[randsg].selected = true;
    }
    function play(list) {
    if (playstate == 2) {
    document.dsrmotion.Play();
    } else {
    var snum = list.options[list.selectedIndex].value
    document.dsrmotion.FileName = videos[snum];
    document.dsrmotion.scr = videos[snum];
    }
    playstate = 1;
    }
    // End -->
    </Script>

    <object width="220" height="160" id="dsrmotion" codebase="http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701" type="application/x-oleobject" standby="Loading Microsoft Windows Media Player components..." classid="CLSID:22d6f312-b0f6-11d0-94ab-0080c74c7e95">
    <param name value>
    <param name="ShowControls" value="0">
    <param name="ShowStatusBar" value="0">
    <param name="ShowDisplay" value="0">
    <param name="DefaultFrame" value="Slide">
    <param name="Autostart" value="1">
    <param name="Loop" value="False">
    <embed width="220" height="160" id="dsrmotion" type="video/x-ms-asf-plugin" transparentatstart="true" SendOpenStateChangeEvents="true" showstatusbar="1" showdisplay="0" autosize="0" autorewind="0" animationstart="0" autostart="0" showcontrols="0">
    </object>

    <form name="form">
    <select style="FONT-SIZE: 8pt; BACKGROUND:#transparent; WIDTH: 150px; COLOR: #33666; font-face: verdana" name="playlist" size="1">
    <option value="0">Video 1</option>
    <option value="1">Video 2</option>
    <option value="2">Video 3</option>
    <option value="3">Video 4</option>
    <option value="4">Video 5</option>
    </select><br>
    <img TYPE="BUTTON" NAME="darkplay" VALUE="play" TITLE="Play" OnClick="play(document.forms['form'].playlist);" src="images/playbutton.jpg" width="27" height="26">
    <img TYPE="BUTTON" NAME="darkpause" VALUE="pause" TITLE="Pause" onClick="document.dsrmotion.Pause(); playstate=2;" src="images/pausebutton.jpg" width="30" height="26">
    <img TYPE="BUTTON" NAME="darkstop" VALUE="stop" TITLE="Stop" OnClick="document.dsrmotion.Stop(); playstate=2;" src="images/stopbutton.jpg" width="27" height="26">
    </form>

  • #2
    Kor
    Kor is offline
    Red Devil Mod Kor's Avatar
    Join Date
    Apr 2003
    Location
    Bucharest, ROMANIA
    Posts
    8,478
    Thanks
    58
    Thanked 379 Times in 375 Posts
    Use the correct reference of the object

    document.getElementById ('dsrmotion').
    KOR
    Offshore programming
    -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*

  • #3
    Regular Coder
    Join Date
    Aug 2004
    Location
    codegoboom@yahoo.com
    Posts
    999
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Actually that's a special case: the element object vs the object it contains.

    getElementById gets the element object, not its contained object, so properties cannot be set on the contained object that way.

    --not that I know why it isn't working
    *this message will self destruct in n-seconds*

  • #4
    Kor
    Kor is offline
    Red Devil Mod Kor's Avatar
    Join Date
    Apr 2003
    Location
    Bucharest, ROMANIA
    Posts
    8,478
    Thanks
    58
    Thanked 379 Times in 375 Posts
    Than probably he might use compounded reference


    document.getElementById (id).getElementsByTagName(childtag)[index].setAttribute(attribute,newvalue)
    KOR
    Offshore programming
    -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*

  • #5
    Regular Coder
    Join Date
    Aug 2004
    Location
    codegoboom@yahoo.com
    Posts
    999
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I think this is beyond the scope of the all mighty DOM--as the object model is external, internally that is...
    *this message will self destruct in n-seconds*

  • #6
    Kor
    Kor is offline
    Red Devil Mod Kor's Avatar
    Join Date
    Apr 2003
    Location
    Bucharest, ROMANIA
    Posts
    8,478
    Thanks
    58
    Thanked 379 Times in 375 Posts
    yea, you might be right... Sometimes I forget that DOM can not do everything...
    KOR
    Offshore programming
    -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*

  • #7
    New to the CF scene
    Join Date
    Mar 2005
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I appreciate your help, still havent found a solution though.

  • #8
    Regular Coder
    Join Date
    Aug 2004
    Location
    codegoboom@yahoo.com
    Posts
    999
    Thanks
    0
    Thanked 0 Times in 0 Posts
    A great place to look is the support section of given browser's website--since they each screw this up in their own special way...
    *this message will self destruct in n-seconds*


  •  

    Posting Permissions

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