By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,717 Members | 1,276 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,717 IT Pros & Developers. It's quick & easy.

Call a video with jscript-function

P: n/a
I have a problem. My function is this

function loadMovie(value){
document.getElementById("VideoID").innerHTML="<OBJ ECT ID=\"video\"
width=\"240\" height=\"180\"
classid=\"CLSID:22D6F312-B0F6-11D0-94AB-0080C74C7E95\"

CODEBASE=\"http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf
..cab#Version=6,4,5,715\" standby=\"Loading Microsoft® Windows® Media Player
components...\" type=\"application/x-oleobject\">"+

"<PARAM NAME=\"AutoStart\" VALUE=\"True\">"+
"<PARAM NAME=\"FileName\"
VALUE=\"http://winmedia.com/clip_"+value+".wmv\">"+
"<PARAM NAME=\"ShowControls\" VALUE=\"False\">"+
"<PARAM NAME=\"ShowStatusBar\" VALUE=\"False\">"+
"<PARAM NAME=\"AutoSize\" VALUE=\"False\">"+
"<PARAM NAME=\"SendPlayStateChangeEvents\" VALUE=\"True\">"+

"<EMBED TYPE=\"application/x-mplayer2\"
SRC=\"http://winmedia.com/clip_"+value+".wmv\" WIDTH=\"240\" HEIGHT=\"180\"
ShowControls=0>"+
"</EMBED> </OBJECT>";
}

The problem is now that the MediaPlayer logo is showing but the movie don't
start??? If I use

document.write("<OBJECT ID=\"video\" width=\"240\...)

that's no problem. The movie run. But I will integrate the movie in my page
and then I needed document.getElementById("VideoID")...

You have solutions

Thank and regards
Jul 20 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
Ruppen Pascal wrote:
function loadMovie(value){
document.getElementById("VideoID").innerHTML="<OBJ ECT ID=\"video\" ^^^^^^^^^^^^^^ ^^^^^^^^^
You are mixing two DOMs (W3C-DOM and DOM-0) without checking for
either one. That is a Bad Thing, see other discussions here.
width=\"240\" height=\"180\"
classid=\"CLSID:22D6F312-B0F6-11D0-94AB-0080C74C7E95\"
To make your source code easier legible, use ' as separators for attribute
strings or use " for the attribute and ' for the JavaScript string separators.
[...]
The problem is now that the MediaPlayer logo is showing but the movie don't
start??? If I use

document.write("<OBJECT ID=\"video\" width=\"240\...)

that's no problem. The movie run. But I will integrate the movie in my page
and then I needed document.getElementById("VideoID")...
I do not see why that is required when document.write(...) will do the trick.
You have solutions


Is that a question?
^
Simplifying your code and not mixing the DOMs as described above is the
first step in debugging that. Using the JavaScript console in Mozilla/5.0
and enable the display of script errors in IE is another.
HTH

PointedEars
Jul 20 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.