View Full Version : Using images in embedded WMP

03-16-2010, 06:53 PM
First...let me start by thanking everyone who contributed to this sticky (http://www.codingforums.com/showthread.php?t=50666) 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 :thumbsup:

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

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!

<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>";

<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>
<br />
<span id="music1">
<embed type="application/x-mplayer2" id="music1"
AutoStart="0" />

03-16-2010, 09:14 PM
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 :D

Well at least that's one problem solved lol