473,398 Members | 2,389 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,398 software developers and data experts.

Call a video with jscript-function

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
1 2344
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

20
by: Harag | last post by:
Hi All. I'm stating out doing some web developing. I was wondering which of the server side languages should I concentrate on and learn. I Know CSS, HTML, T-SQL I can look at the client...
4
by: Harag | last post by:
Hi All I currently thinking of converting from my little knowledge of VBscript to jScript ASP. With this in mind I'm looking at my current code to see how it will convert over to Jscript. ...
5
by: jen_designs | last post by:
How do I create custom controls for an embeded video. I need stop, play, pause, etc. Any thoughts?
4
by: Keith Chadwick | last post by:
Is it possible to, for example: <xsl:variable name="thetemplate" test="props/prop/@value"/> <xsl:call-template name="$thetemplate"/> I tried {$template} as well. Comes back as invalid qname. ...
1
by: Lonewolf | last post by:
Hi everyone, pls forgive me for my lack of knowledge and skills if my question sounds very stupid. I am trying to implement a video conferencing software and I am currently looking at a few set of...
8
by: Nehmo | last post by:
When a page has a JavaScript "link" to a video, like http://www.msnbc.msn.com/id/10478942/ . How do you get the URL of the actual video? Isn't it in the source somewhere? -- )|:__ Nehmo __:|(
5
by: Maxwell2006 | last post by:
Hi, I have a requirement to develop an application component using only Server-Side Jscript (not Jscript.NET). What is Server-Side Jscript?
12
by: Pallas | last post by:
Hi all, I've produced some high-def videos and I want people to be able to watch them on my website, but I may want to prevent downloads and I certainly want to prevent them from editing them....
2
by: hzgt9b | last post by:
Using VS2003, VB.NET, BACKGROUND I have a window forms based application that will be distributed and executed directly from CD media. The app contains a TreeView control and a WebBroswer...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.