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 2 of 2
  1. #1
    Regular Coder harlequin2k5's Avatar
    Join Date
    Sep 2005
    Location
    Holiday, FL
    Posts
    635
    Thanks
    18
    Thanked 0 Times in 0 Posts

    Using images in embedded WMP

    First...let me start by thanking everyone who contributed to this sticky (Embedded Windows Media Player) because I don't think I could have gotten this far without all of the questions and all of the great support and guidance provided by Aero

    Below is the code I'm using for wmp and all of it is working quite perfectly across Firefox, IE and Chrome

    Even after going through almost the entire thread and then doing subsequent searches throughout this topic, I don't believe I've found the answer I'm looking for. Mind you, it is possible that an answer has previously been provided and I've just been too blinded and overloaded by information to have seen it.

    My first question is: is there a way to use an image that correlates to the mp3 being played instead of the wmp visualization?

    My second question is: is there a way to link an image to the player that's already embedded? In other words, I have an image within the page itself that I wish to call attention to and have users click the image to hear the mp3 that is in the <select> playlist.

    As always...any help is greatly appreciated!

    Code:
    <script type="text/javascript"><!--
    function song(){
    document.getElementById('music1').innerHTML="<embed type='application/x-mplayer2' id='music2' \n\
    pluginspage='http://www.microsoft.com/Windows/MediaPlayer/' src='"+document.getElementById('cancion').value+"' name='MediaPlayer1' \n\
    width='250' height='150' controltype='2' showcontrols='1' showstatusbar='1' AutoStart='true'></embed>";
    }
    //-->
    </script>
    Code:
    <div id="jukebox" align="center">
              <select  id="cancion" onchange="song()" size="1" style="border:#ffff00 1px solid;width:250px;font-family:'Trebuchet MS',Verdana;padding-left:5px;">
                <option value="none">::::::::: Make Your Selection :::::::::</option>
                <option value="<?php echo WEBSITE_URL; ?>/samples/MothersHeart.mp3">Mother's Heart</option>
                <option value="<?php echo WEBSITE_URL; ?>/samples/Cold_Turkey.mp3">Cold Turkey</option>
                <option value="<?php echo WEBSITE_URL; ?>/samples/Until.mp3">Until</option>
              </select>
              <br />
              <span id="music1">
                <embed type="application/x-mplayer2" id="music1"
                       pluginspage="http://www.microsoft.com/Windows/MediaPlayer/"
                       src=""
                       name="MediaPlayer1"
                       width="250"
                       height="150"
                       controltype="2"
                       showcontrols="1"
                       showstatusbar="1"
                       AutoStart="0" />
                </embed>
              </span>
            </div>

  • #2
    Regular Coder harlequin2k5's Avatar
    Join Date
    Sep 2005
    Location
    Holiday, FL
    Posts
    635
    Thanks
    18
    Thanked 0 Times in 0 Posts
    My first question is: is there a way to use an image that correlates to the mp3 being played instead of the wmp visualization?
    As it turns out, both of the mp3's being played on the site are being sung by the same person...I added an <img> between the <select> and the <embed> and it all displays perfectly

    Well at least that's one problem solved lol


  •  

    Posting Permissions

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