PDA

View Full Version : questions about a script



riptide
06-28-2007, 09:21 PM
okay Ihave this script I can't get it to work right but it off of something that does work. here are my questions. 1: is it cross browser? 2:what do I need to do if I wanted to add a quicktime player to it?

function playSongs(){

var sel = document.forms.sell;
document.getElementById('MTVplayer').innerHTML=
is innerHTML cross browser?'<object width="250" height="59" id="Player"
classid="CLSID:6BF52A52-394A-1
1d3-B153-00C04F79FAA6" type="application/x-oleobject">
<param name="URL" value="'+document.getElementById('sell').value+'">
<param name="autoStart" VALUE="true">
<param name="uiMode" value="full">
<param name="currentPosition" vaule="1" >
<param name="ShowStatusBar" value="true" >
<embed type="application/x-mplayer2" src="'+document.getElementById('sell')
.value+'" ShowControls="0" width="250" height="50"></embed></object>';
do I need to add the quictime player here}



<div id="chooseshow">
<input type="button" value="Play" onclick="playSongs();finded()" />


<select name="sel1" size="4" multiple="multiple" id="misterio" onchange="">
<option value="Digimon Season 2 - Episode 19 - An Old Enemy Returns.wmv" >digimon</option>
<option value="http://www.fileden.com/files/200
6/11/20/398972/02&#37;20-%20TOOL%20-%2010000%20DAYS%20-%20JAMBI.mp3">tool-jumbie</option>
<option value="http://www.fileden.com/files/2006/11/20/3
98972/Cradle%20Of%20Filth%20-Nymphetamin
e.mp3">Cradle of Filth-Nymphetamine</option>
<option value="http://www.fileden.com/fil
es/2006/11/20/398972/Black%20Light%20Bu
rns%20-%20Lie(1).mp3">Black Light Burns-Lie</option>
</select>
</div>


<div id="MTVplayer">
<object id="fileObj" width="300" height="450"
classid="CLSID:22d6f312-b0f6-11d
0-94ab-0080c74c7e95"
codebase="http://activex.microsoft.com/ac
tivex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701"
standby="Loading Microsoft Windows Media Player components..." type="application/x-oleobject">
<param name="fileName" value="'window.retry'">
<param name="autoStart" value="true">
<param name="showControls" value="true">
<param name="loop" value="false">
<param name="uiMode" value="full">
<embed id="fileEmb" type="application/x-mplayer2"
src="'window.retry'"
ShowControls="1"
width="235"
height="160">
</embed>
</object>
</div>]

If I add the quicktime player up there I need one her right. cause I have one in my real code

riptide
06-29-2007, 08:35 PM
here I give you the link to the site I got the idea off of

http://codingforums.com/showthread.php?t=50666&page=2

???
07-01-2007, 03:42 PM
This is mostly HTML and I have no clue about quicktime because somepeople use other things, but yes, .innerHTML is cross browser, I'm not sure to what extent but I believe it works in Firefox and IE.

riptide
07-01-2007, 05:33 PM
oh good. I hope most people use IE and FF when they come to my site.
I guess I can do the same with quicktime as with WMP if something goes wrong I'll reply.

riptide
07-05-2007, 07:34 PM
okay I tok their code and changed it around a bit. it doesn't work in firefox. I have an idea why but first it's just not working right in IE. here I ''l show you what I did.

function song(){
document.getElementById('music1').innerHTML="<embed type='application/x-mplayer2'
id='music2' pluginspage='http://www.microsoft.com/Windows/MediaPlayer/'
src='"+document.getElementById('cancion').value+"'
name='MediaPlayer1' width='300' height='75'
controltype='2' showcontrols='1' showstatusbar='1' AutoStart='true'></embed>";
}


function song2(){
document.getElementById('music3').innerHTML="
<embed type='video/quicktime' id='music4' pluginspage='http://www.apple.com/quicktime/download/'
src='"+document.getElementById('cancion2').value+"' name='MediaPlayer5' width='300' height='75' controller="false"
autoplay="true"></embed>";
}

//-->
</script>

That's the head section



<div id="jukebox">JUKEBOX<br><br>
<select id="cancion" onchange="song()" size="1">
<option value="none">::::::::::::: Choose Your Song Here :::::::::::::</option>
<option value="Digimon Season 2 - Episode 19 - An Old Enemy Returns.wmv ">Song 1</option>
<option value="http://urltosong2.mp3">Song 2</option>
<option value="http://urltosong3.mp3">Song 3</option>
<option value="http://urltosong4.mp3">Song 4</option>
<option value="http://urltosong5.mp3">Song 5</option>
<option value="http://urltosong6.mp3">Song 6</option>
<option value="http://urltosong7.mp3">Song 7</option>
<option value="http://urltosong8.mp3">Song 8</option>
<option value="http://urltosong9.mp3">Song 9</option>
<option value="http://urltosong10.mp3">Song 10</option>
</select><br>
<span id="music1"><embed type="application/x-mplayer2" id="music1"
pluginspage="http://www.microsoft.com/Windows/MediaPlayer/"
src=""
name="MediaPlayer1"
width="300"
height="70"
controltype="2"
showcontrols="1"
showstatusbar="1"
AutoStart="0">
</embed></span>
</div>


<select id="cancion2" onchange="song2()" size="1">
<option value="none">::::::::::::: Choose Your Song Here :::::::::::::</option>
<option value="Digimon Season 2 - Episode 19 - An Old Enemy Returns.wmv ">Song 1</option>
<option value="http://urltosong2.mp3">Song 2</option>
<option value="http://urltosong3.mp3">Song 3</option>
<option value="http://urltosong4.mp3">Song 4</option>
<option value="http://urltosong5.mp3">Song 5</option>
<option value="http://urltosong6.mp3">Song 6</option>
<option value="http://urltosong7.mp3">Song 7</option>
<option value="http://urltosong8.mp3">Song 8</option>
<option value="http://urltosong9.mp3">Song 9</option>
<option value="http://urltosong10.mp3">Song 10</option>
</select>

<span id="music3"><embed type="video/quicktime" id="music3"
pluginspage="http://www.microsoft.com/Windows/MediaPlayer/"
src=""
name="MediaPlayer1"
width="300"
height="70"
controller="false"
autoplay="true"
autoplay="true">
</embed></span>


The body section. I just don't understand why I can't make a select player for quictime.