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 6 of 6
  1. #1
    New to the CF scene
    Join Date
    Feb 2007
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    onChange Event not working in Firefox

    Hey All. I've been trying for a few days to create an embedded media player with drop down menu that changes which video is being played in the player. Code works fine in IE, but no luck in FF. Any suggestions would be greatly appreciated.

    <OBJECT ID="MediaPlayer" width=608 height=511 classid="CLSID:22D6F312-B0F6-11D0-94AB-0080C74C7E95" codebase="http://activex.microsoft.com/activex/controls/ mplayer/en/nsmp2inf.cab#Version=5,1,52,701" standby= "Loading Media Player" type="application/x-oleobject">
    <PARAM NAME="FileName" VALUE="intro.wmv">
    <PARAM NAME="AutoStart" Value="True">
    <PARAM NAME="ShowControls" VALUE="True">
    <PARAM NAME="ShowStatusBar" VALUE="True">
    <PARAM NAME="Loop" VALUE="True">

    <EMBED type="application/x-mplayer2" pluginspage="http://www.microsoft.com/Windows/MediaPlayer/" SRC="intro.wmv" width=608 height=511 name="MediaPlayer" autostart="1" ShowStatusBar=1 ShowControls=1 >
    </EMBED></OBJECT>


    <body>
    <body><body><body>

    <body>
    </p>
    <FORM name="MediaForm">
    <p align="center"><font size="5">
    <SELECT NAME="VidChange" onChange="{document.MediaPlayer.FileName = document.MediaForm.VidChange.options[document.MediaForm.VidChange.selectedIndex].value}">
    <OPTION VALUE="intro.wmv">Select a WiFiLynx Movie
    <OPTION VALUE="sunshine.wmv">Little Miss Sunshine
    <OPTION VALUE="smoking.wmv">Thank You For Smoking
    <OPTION VALUE="underground.wmv">Underground Archive
    <OPTION VALUE="iceage.wmv">Ice Age
    </SELECT></font></p>

  • #2
    Senior Coder nikkiH's Avatar
    Join Date
    Jun 2005
    Location
    Near Chicago, IL, USA
    Posts
    1,973
    Thanks
    1
    Thanked 32 Times in 31 Posts
    Firefox is a lot pickier about valid html. That's really, really invalid. You've got multiple body elements, incorrectly nested tags, missing end tags...

    Try fixing that first, and then change to getElementById instead of that shortcut syntax where you can't tell if it's using the ID or the name of the element.

    If this post contains any code, I may or may not have tested it. It's probably just example code, so no getting knickers in a bunch over a typo, OK? If it doesn't have basic error checking in it, such as object detection or checking if objects are null before using them, put that in there. I'm giving examples, not typing up your whole app for you. You run code at your own risk.
    Bored? Visit
    http://www.kaelisspace.com/

  • #3
    New to the CF scene
    Join Date
    Feb 2007
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Thanks for your response NikkiH...does this look better?

    <!-- begin embedded WindowsMedia file... --><br>
    <br>
    <table border='0' cellpadding='0' align="center">
    <tr>
    <td><object id="MediaPlayer" width="608" height="511" classid=
    "CLSID:22D6F312-B0F6-11D0-94AB-0080C74C7E95" codebase=
    "http://activex.microsoft.com/activex/controls/%20mplayer/en/nsmp2inf.cab#Version=5,1,52,701"
    standby="Loading Media Player" type=
    "application/x-oleobject"><param name="FileName" value="intro.wmv">
    <param name="AutoStart" value="True">
    <param name="ShowControls" value="True">
    <param name="ShowStatusBar" value="True">

    <param name="Loop" value="True">
    <embed type="application/x-mplayer2" pluginspage=
    "http://www.microsoft.com/Windows/MediaPlayer/" src="intro.wmv"
    width="608" height="511" name="MediaPlayer" autostart="1"
    showstatusbar="1" showcontrols="1"></object><br>
    <br>
    <form name="MediaForm">
    <p align="center"><font size="5"><select name="VidChange" onchange=
    "{document.MediaPlayer.FileName = document.MediaForm.VidChange.options[document.MediaForm.VidChange.selectedIndex].value}">
    <option value="intro.wmv">Select a WiFiLynx Movie</option>
    <option value="sunshine.wmv">Little Miss Sunshine</option>
    <option value="smoking.wmv">Thank You For Smoking</option>
    <option value="underground.wmv">Underground Archive</option>
    <option value="iceage.wmv">Ice Age</option>
    </select></font></p>
    </form>

    </td>
    </tr>
    </table>
    </td>
    </tr>
    </table>
    </td>
    </tr>
    </table>
    </td>
    </tr>
    </table>
    </body>
    </html>


    **I am very new to all of this and have come across getElementbyId but I am not sure where to put it in**

  • #4
    Supreme Master coder! _Aerospace_Eng_'s Avatar
    Join Date
    Dec 2004
    Location
    In a place far, far away...
    Posts
    19,291
    Thanks
    2
    Thanked 1,043 Times in 1,019 Posts
    Go to the Multimedia forum and read the sticky titled "Embedded Windows Media Player". I mean read the whole thing, your answer is there. Trust me I remember giving the code numerous times.
    ||||If you are getting paid to do a job, don't ask for help on it!||||

  • #5
    Senior Coder nikkiH's Avatar
    Join Date
    Jun 2005
    Location
    Near Chicago, IL, USA
    Posts
    1,973
    Thanks
    1
    Thanked 32 Times in 31 Posts
    That html looks MUCH better.

    And here's the link to the other post.
    Embedded Windows Media Player

    If this post contains any code, I may or may not have tested it. It's probably just example code, so no getting knickers in a bunch over a typo, OK? If it doesn't have basic error checking in it, such as object detection or checking if objects are null before using them, put that in there. I'm giving examples, not typing up your whole app for you. You run code at your own risk.
    Bored? Visit
    http://www.kaelisspace.com/

  • #6
    New to the CF scene
    Join Date
    Feb 2007
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Much Thanks you two....I stumbled upon said thread a few day back, but did not realize it was 41 pages long.

    I'm tweaking right now, but have already got the getElementById working properly.


    I'm sure I'll be finding more as I keep making it through that thread...it's only my 3rd day of messing around with code and its starting to sink in, but I really do appreciate your knowledge and patience


  •  

    Posting Permissions

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