johnd126 wrote:
Quote:
The basic output of my program is (and my working test program is
similar)
<html>
<head>
<script type='text/javascript' language='javascript1.2'>
>
function myFunction(){
document.myObj.myFunction();
}
>
function runIt(){
setTimeout('myFunction()', 1000);
}
</script>
</head>
<body onLoad='runIt()'>
<object id='myObj' style='position:absolute; top:0; left:0;'
width='100' height='100'
CLASSID='CLSID:6BF52A52-394A-11d3-B153-00C04F79FAA6'
type='application/x-oleobject'>
</object>
</body>
</html>
>
Any ideas where to look would be appreciated!
This will not work for Firefox for 3 reasons, one main and two
additional:
[Reason One]
Media plugin support on Gecko browsers badly sucks.
Simply clicking a link like
<http://members.aol.com/jrzycrim01/mozilla/wmp/vidtest-LS.wmvwill
successfully launch WMP wherever installed, no problems whatsoever.
At the same time with WMP embedded into the page itself you cut off
50%-80% of Firefox users with WMP installed. It will work only for very
lucky ones where the installation and ActiveX registration passed by
extremely picky, tricky and fragile Firefox requirements.
That means that irrelevant to your current problems it is highly
suggested to check something like:
WMP.isPlayerInstalled = (
(typeof navigator.mimeTypes != 'undefined')
&& (typeof navigator
.mimeTypes['video/x-ms-wmv'] != 'undefined')
&& (typeof navigator.mimeTypes['video/x-ms-wmv']
.enabledPlugin != 'undefined')
&& (typeof navigator.mimeTypes['video/x-ms-wmv']
.enabledPlugin.name == 'string')
&& (navigator.mimeTypes['video/x-ms-wmv']
.enabledPlugin.name.indexOf('Windows Media Player') != -1));
and embed into page only if true. If false then still provide regular
links to wmv files if on Windows platform: the chances are very high
that WMP is perfectly here, just not "visible" to the browser.
[Reason Two]
Firefox doesn't allow to embed a *player* - you can only embed a
*really existing media file*. Embedding such file will lead to
embedding WMP itself, but the second cannot happen without the first.
URL check goes first, so with a bogus media file the embedding will not
happen. Moreover both [data] attribute and [src] param have to be set
and point to the same valid file. You are not getting headache yet? ;-)
Then I'll continue.
This way a working <objectcode for Firefox will be:
<object data="some_real.wmv"
type="video/x-ms-wmv"
width="320" height="320">
<param name="ShowStatusBar" value="1">
<param name="src" value="some_real.wmv">
<param name="autostart" value="0">
<param name="volume" value="0">
</object>
[Reason Three]
To embed media plugins into page it is possible to use both <object>
and <embed>. The "catch 22" is that *only* <embedwill create
scriptable object, so you can contact it using JavaScript.
So the reason it works on your "big" page but fails on the posted short
sample is very simple: on the "big" page you are using the traditional
<object><embed></embed></objectcombo where Firefox takes the <embed>
part and so semi-working. Then you decided to "optimize" your code so
removed <embed- and Firefox got nuked.