Forum Moderators: phranque

Message Too Old, No Replies

IE6: "Press OK to continue loading the content of this page"

Embedding QuickTime movies causes error in IE 6

         

MatthewHSE

3:06 pm on Dec 5, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I'm using the following code to embed QuickTime movies in a webpage. It works fine in Firefox, Chrome, and IE7. But IE 6 pops up a confirmation box saying to "Click OK to continue loading the content of this page" before it will load the movie. The "solutions" I've found elsewhere online say to use document.write for the relevant code, but I'm already doing that.

Here's how I'm doing it. Note that on the site, the Javascript function is actually an external file.

<html>

<head>

<title>QuickTime Movie</title>

<script type="text/javascript">
function embed(file,width,height) {
document.write('<!--[if IE]><style type="text/css">object {position: relative; bottom: 3px;}</style><![endif]-->');
document.write('<object classid="clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B" codebase="http://www.apple.com/qtactivex/qtplugin.cab" height="'+height+'" width="'+width+'" class="QTembed">');
document.write('<param name="src" value="http://www.example.com/media/'+file+'.mov">');
document.write('<param name="autoplay" value="true">');
document.write('<param name="type" value="video/quicktime" height="'+height+'" width="'+width+'">');
document.write('<embed src="http://www.example.com/media/'+file+'.mov" height="'+height+'" width="'+width+'" autoplay="true" type="video/quicktime" pluginspage="http://www.apple.com/quicktime/download/" bgcolor="000000"></embed>');
document.write('</object>');
}
</script>

</head>

<body>

<script type="text/javascript">
embed('moviefile','300','190');
</script>

</body>

</html>

Any ideas on how I can fix this?

Thanks,

Matthew

[edited by: MatthewHSE at 3:41 pm (utc) on Dec. 5, 2008]

phranque

12:07 pm on Dec 19, 2008 (gmt 0)

WebmasterWorld Administrator 10+ Year Member Top Contributors Of The Month



have you tried moving that javascript function to an external file and including it with a <script> tag in the <head>?
just a guess - perhaps the inline javascript gets processed while the page is being loaded.

this link describes the details but i think the external js is the key:
[developer.apple.com...]

MatthewHSE

3:35 pm on Dec 19, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Actually the Javascript already is in an external file on the actual site. Here's a more accurate representation of what I have:

External Javascript:

function embed(file,width,height) {
document.write('<!--[if IE]><style type="text/css">object {position: relative; bottom: 3px;}</style><![endif]-->');
document.write('<object classid="clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B" codebase="http://www.apple.com/qtactivex/qtplugin.cab" height="'+height+'" width="'+width+'" class="QTembed">');
document.write('<param name="src" value="http://www.example.com/media/'+file+'.mov">');
document.write('<param name="autoplay" value="true">');
document.write('<param name="type" value="video/quicktime" height="'+height+'" width="'+width+'">');
document.write('<embed src="http://www.example.com/media/'+file+'.mov" height="'+height+'" width="'+width+'" autoplay="true" type="video/quicktime" pluginspage="http://www.apple.com/quicktime/download/" bgcolor="000000"></embed>');
document.write('</object>');
}

HTML page:

<html>
<head>
<title>QuickTime Movie</title>
<script type="text/javascript" src="/path/to/embed.js"></script>
</head>
<body>
<script type="text/javascript">
embed('moviefile','300','190');
</script>
</body>
</html>

By everything I've read about this, the setup I have *should* work. But it doesn't...

Further ideas very much welcome!

Samizdata

4:42 pm on Dec 19, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



I have been using qtObject for a couple of years (since the EOLAS debacle) - it is from the same stable as swfObject, completely free, and it works fine with IE6 and other browsers.

...

kaled

5:19 pm on Dec 19, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Just a guess...

Strictly, / characters should be escaped in write statements when used to create a closing tag (and the javascript is embedded in an HTML page).

document.write('<\/object>');

Kaled.

D_Blackwell

4:58 am on Dec 22, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I cannot help with your problem, but QuickTime has caused me, as a user, much grief on numerous browsers. That has always been the case, and continues to this day from to time; either won't load, or will freeze. IE, FF, doesn't seem to matter. Am no fan of QuickTime at all.

MatthewHSE

2:29 pm on Dec 22, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Actually this may have been a totally different problem. I was testing in the IE6 standalone previously, which required the confirmation click. This morning I was able to fire up a W2K virtual machine, which loaded the movie just as it should have.

Sorry for the wild goose chase. I should have figured an IE standalone could cause problems like this.

QuickTime has caused me, as a user, much grief on numerous browsers. That has always been the case, and continues to this day from to time; either won't load, or will freeze. IE, FF, doesn't seem to matter. Am no fan of QuickTime at all.
Ditto. I suggested some other options (and my reasons), but the site-owner felt that QuickTime provided the highest quality video. So what's a webmaster to do? ;)