View Full Version : Help with quicktime and WMP

05-15-2007, 03:55 PM
I managed to get a quick time and windows media player detection script working

but if you have the player
if(player ==true){fixcode()}

I have a code to write out quicktime.

function fixcode (){ document.write('<object classid="clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B"

codebase="http://www.apple.com/qtactivex/qtplugin.cab" width="320" height="256">');
document.write('<param name="src"
value="http://www.knallgrau.at/code/plugin_js/demo/video-embeding/files/skifoan.mov" />');
document.write('<param name="autoplay" value="true" />');
document.write('<param name="controller" value="true" />');
src="http://www.knallgrau.at/code/plugin_js/demo/video-embeding/files/skifoan.mov" width="320" height="256" type="video/quicktime"
pluginspage="http://www.apple.com/quicktime/download/" autoplay="false" controller="true" />');
the problem is when I just write it out normaly it works and you can see the movie. But when I use document write it dosen't play but there are no errors.
I searched many sites but I don't see a clear explainion for why this won't work.

I even tried making an object and using createElement. Still no luck.

05-15-2007, 05:35 PM
Is there something i'm misssing here?

05-15-2007, 05:55 PM
Is there something i'm misssing here?
The realisation, perhaps, that no-one here knows a solution?

05-15-2007, 07:47 PM
so...no one has tried to embed a player like this.

05-15-2007, 07:53 PM
so...no one has tried to embed a player like this.I know I haven't.

05-15-2007, 08:16 PM
This is a stab in the dark, but would it make a difference if the object was written all at once.


Use DOM techniques?

05-15-2007, 08:26 PM
This is a stab in the dark, but would it make a difference if the object was written all at once.

I think there has been a case where outputting a start-tag first and the end-tag later caused the browser to error-correct the document, closing the element immediately. I don't remember the circumstances, though.

Quite a possibility...

Use DOM techniques?

The OP already tried that. :)

05-16-2007, 12:57 AM
I think I only got an error when I used an object. the other times I got no errors. I did try writing it out all in one document.write I still didn't get an error or have it play.

05-16-2007, 03:34 PM
I decided to have the player written out.

in the body

<OBJECT id='mediaPlayer' width="320" height="240"
codebase='http://activex.microsoft.com/activex/controls/ mplayer/en/nsmp2inf.cab#Version=5,1,52,701'
standby='this will take some time<img src='misterioloder'' type='application/x-oleobject'>
<param name='fileName' value="">
<param name='animationatStart' value='1'>
<param name='transparentatStart' value='1'>
<param name='autoStart' value='1'>
<param name='ShowControls' value='1'>
<param name='ShowStatusBar' value='0'>
<param name='loop' value='0'>
<EMBED type='application/x-mplayer2'
pluginspage='http://microsoft.com/windows/mediaplayer/ en/download/'
id='mediaPlayer2' name='mediaPlayer' displaysize='4' autosize='0'
bgcolor='darkblue' showcontrols='true' showtracker='true'
showdisplay='0' showstatusbar='0' videoborder3d='0' width="320" height="240"
src='' autostart='1' designtimesp='5311' loop='0'>

<a id="thebiglink" href="http://www.knallgrau.at/code/plugin_js/demo/video-embeding/files/skifoan.wmv" onclick="return false">clickhere</a>

but I'm trying to load the file from a link into the embed src.
I can't load the link to the objects param because I can't use createElement("param")

document.getElementById("mediaPlayer2").setAttribute("src", document.getElementById("thebiglink").getAttribute("href"));

I thougth about loading the files from an array. But I need to have the links connected to the right files in the array and I don't know how to do that.