I'm using the following code to dynamically build an OBJECT tag to
display a QuickTime movie:
window.onload = function() {
addParam = function(p,n,v) { /* parent, name, value */
var c = document.createElement("param");
c.name = n;
c.value = v;
p.appendChild(p);
}
// parameters
var vidUrl = "media/sample.mov";
var vidTop = 100;
var vidLeft = 150;
var vidWidth = 320;
var vidHeight = 240;
var vidCont = 17; /* add 17px for the QT controller */
// create a DIV to contain the QT OBJECT
var v = document.createElement("div");
v.setAttribute("id", "videoContainer");
v.style.position = "absolute";
v.style.left = "0px";
v.style.top = "0px";
document.body.appendChild(v);
// QT OBJECT for non IE
var m = document.createElement("object");
m.data = vidUrl;
m.type = "video/quicktime";
m.width = vidWidth;
m.height = vidHeight + vidCont;
m.style.position = "absolute";
m.style.left = vidLeft + "px";
m.style.top = vidTop + "px";
addParam(m,"AutoStart","false");
addParam(m,"Controller","true");
v.appendChild(m);
}
It works (by that I mean the movie with its controller appears and
plays) in MZ but in FF the missing plugin notice appears. Yet if I write
the code directly into my HTML it also plays in FF. How can I get this
to work in FF?
Andrew Poulos 4 3408
Andrew Poulos wrote: I'm using the following code to dynamically build an OBJECT tag to display a QuickTime movie:
window.onload = function() { addParam = function(p,n,v) { /* parent, name, value */ var c = document.createElement("param"); c.name = n; c.value = v; p.appendChild(p); }
// parameters var vidUrl = "media/sample.mov"; var vidTop = 100; var vidLeft = 150; var vidWidth = 320; var vidHeight = 240; var vidCont = 17; /* add 17px for the QT controller */
// create a DIV to contain the QT OBJECT var v = document.createElement("div"); v.setAttribute("id", "videoContainer"); v.style.position = "absolute"; v.style.left = "0px"; v.style.top = "0px"; document.body.appendChild(v);
// QT OBJECT for non IE var m = document.createElement("object"); m.data = vidUrl; m.type = "video/quicktime"; m.width = vidWidth; m.height = vidHeight + vidCont; m.style.position = "absolute"; m.style.left = vidLeft + "px"; m.style.top = vidTop + "px"; addParam(m,"AutoStart","false"); addParam(m,"Controller","true"); v.appendChild(m);
Does it improve things if you reorder the appendChild calls to first
build the object with the params, then the div and finally append the
div to the body e.g.
var v = document.createElement("div");
v.setAttribute("id", "videoContainer");
v.style.position = "absolute";
v.style.left = "0px";
v.style.top = "0px";
var m = document.createElement("object");
m.data = vidUrl;
m.type = "video/quicktime";
m.width = vidWidth;
m.height = vidHeight + vidCont;
m.style.position = "absolute";
m.style.left = vidLeft + "px";
m.style.top = vidTop + "px";
addParam(m,"AutoStart","false");
addParam(m,"Controller","true");
v.appendChild(m);
document.body.appendChild(v);
It works (by that I mean the movie with its controller appears and plays) in MZ but in FF the missing plugin notice appears. Yet if I write the code directly into my HTML it also plays in FF. How can I get this to work in FF?
That sounds indeed unusual that it works with Mozilla but not Firefox.
What Mozilla version is that exactly, what Firefox version exactly?
Mozilla 1.7.5 should behave the same as Firefox 1.0.
--
Martin Honnen http://JavaScript.FAQTs.com/
Andrew Poulos wrote: I'm using the following code to dynamically build an OBJECT tag to display a QuickTime movie:
window.onload = function() { addParam = function(p,n,v) { /* parent, name, value */ var c = document.createElement("param"); c.name = n; c.value = v; p.appendChild(p);
That should be:
p.appendChild(c);
Works fine for me in FF 1.0 and Mozilla 1.3 (OK, I ditched
Mozilla when FF became good enough so haven't updated).
Martin Honnen wrote:
[snip] Does it improve things if you reorder the appendChild calls to first build the object with the params, then the div and finally append the div to the body e.g.
var v = document.createElement("div"); v.setAttribute("id", "videoContainer"); v.style.position = "absolute"; v.style.left = "0px"; v.style.top = "0px";
var m = document.createElement("object"); m.data = vidUrl; m.type = "video/quicktime"; m.width = vidWidth; m.height = vidHeight + vidCont; m.style.position = "absolute"; m.style.left = vidLeft + "px"; m.style.top = vidTop + "px"; addParam(m,"AutoStart","false"); addParam(m,"Controller","true"); v.appendChild(m);
document.body.appendChild(v);
Unfortunately, it made no difference. I checked the DOM inspector in FF
and I've found that the attribute type="video/quicktime" has not been
set for the OBJECT tag (it *is* set in MZ). So when I try to play
different types of video files that are compatible with the QT plugin
some work and some don't. For example:
- .AVI doesn't play
- .MOV plays
- .MPG plays
They all work if I code the HTML directly.
I just checked the list of installed plugins in FF and AVI is not listed
so I guess that not being able to set the TYPE attribute and it not
being listed means there's no way to get the QT plugin to play a .avi.
I think this issue has been discussed before but I thought it only
impacted IE. I also think I'm snookered unless there's some way to
define a TYPE attribute dynamically or some other workaround :-( It works (by that I mean the movie with its controller appears and plays) in MZ but in FF the missing plugin notice appears. Yet if I write the code directly into my HTML it also plays in FF. How can I get this to work in FF?
That sounds indeed unusual that it works with Mozilla but not Firefox. What Mozilla version is that exactly, what Firefox version exactly? Mozilla 1.7.5 should behave the same as Firefox 1.0.
I'm testing on MZ 1.7.5 and FF 1.0 (both under WinXP SP1).
Andrew Poulos
Andrew Poulos wrote: That sounds indeed unusual that it works with Mozilla but not Firefox. What Mozilla version is that exactly, what Firefox version exactly? Mozilla 1.7.5 should behave the same as Firefox 1.0.
I'm testing on MZ 1.7.5 and FF 1.0 (both under WinXP SP1).
I have filed a bug on bugzilla:
<https://bugzilla.mozilla.org/show_bug.cgi?id=277434>
maybe the behaviour has some reason but maybe it is a bug. If you are
interested on how that is decided you can add yourself to the CC list of
that bug.
--
Martin Honnen http://JavaScript.FAQTs.com/ This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: Roel Wuyts |
last post by:
CALL FOR CONTRIBUTIONS
International Workshop on Revival of Dynamic Languages
http://pico.vub.ac.be/~wdmeuter/RDL04/index.html
(at OOPSLA2004, Vancouver, British Columbia, Canada, October...
|
by: prashna |
last post by:
Hi all,
Is'nt a function invocation through a function pointer is dynamic
binding?
For example consider the following program
1 int main()
2 {
3 int (*fun_ptr)();
4 int...
|
by: Stephen Gennard |
last post by:
Hello,
I having a problem dynamically invoking a static method that takes a
reference to a SByte*. If I do it directly it works just fine.
Anyone any ideas why?
I have include a example...
|
by: Jeff Poste |
last post by:
Hi,
I'm developing software that requires business rules that
constantly need new versions for different quarters,
years, etc. I created a business rule factory that stores
these different...
|
by: john |
last post by:
Hi,All MS Tech Gurus:
I need your help!!! It is the second time I post this message, I need get
some feedback ASAP, Please Help!!
Thanks a lot in advance.
John
I have a csharp method, using...
|
by: Leo J. Hart IV |
last post by:
OK, here's another question for the experts:
I am building a multi-step (3 steps actually) form using a panel for
each step and hiding/displaying the appropriate panel/panels depending
on which...
|
by: Jakob Lithner |
last post by:
I have searched the news groups on similar subjects, but
haven't found anything adequate for my need ....
To save much duplication of code I would like to create a
baseclass that takes a...
|
by: Kris Palmer |
last post by:
hi,
can somebody explain this problem? it's driving me crazy!
i have a requirement to dynamically create a variable quantity of timers
with associated start button based on the contents of a...
|
by: George Meng |
last post by:
I got a tough question:
The backgroud for this question is:
I want to design an application works like a engine.
After release, we can still customize a form by adding a button, and source
code...
|
by: Pascal Costanza |
last post by:
Dynamic Languages Day @ Vrije Universiteit Brussel
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Monday, February 13, 2006, VUB Campus Etterbeek
The VUB (Programming Technology Lab,...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
by: ryjfgjl |
last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
|
by: emmanuelkatto |
last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud.
Please let me know.
Thanks!
Emmanuel
|
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...
|
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...
|
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,...
|
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,...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
| |