Quicktime and AJAX

I would like to play a QT movie in a specified location on my page. There is a .gif file that <onclick> I'd like to turn into a playing movie.

I was told AJAX could/ would help this. Has anyone here done something similar?

14 inch ibook G4 1.25gb/ 20" Intel iMac 2GB 250GB 256vram, Mac OS X (10.4.7), 30GB Photo/ 2GB Nano

Posted on Feb 15, 2007 3:07 PM

Reply
15 replies

Feb 15, 2007 3:23 PM in response to Boss 33

Actually, that's one of the canonical methods for embedding a QuickTime movie.

Turn your GIF image into a QuickTime movie, and embed it into the web page in the usual fashion. To be 100% compliant with the new way of doing things, you'll need to concoct some JavaScript (available on Apple's site) to generate this code on the fly, otherwise it will take two clicks to start the movie in Internet Explorer...The embed code should look something like this:

<OBJECT CLASSID="clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B"
WIDTH="www"HEIGHT="hhh"
CODEBASE="http://www.apple.com/qtactivex/qtplugin.cab">
<PARAM name="SRC" VALUE="MyGIFImage.mov">
<PARAM name="AUTOPLAY" VALUE="true">
<PARAM name="CONTROLLER" VALUE="false">
<PARAM name="LOOP" VALUE="false">
<PARAM name="HREF" VALUE="MyMovie.mov">
<PARAM name="TARGET" VALUE="myself">
<embed src="MyGIFImage.mov"
width="www"
height="hhh"
controller="false"
autoplay="true"
loop="false"
href="MyMovie.mov"
target="myself"
pluginspage="http://www.apple.com/quicktime">
</embed>
</object>

Substitute the actual height and width for the hhh and www parameters, of course. Include the controller if you wish. Also, note that the URL of the movie specified in the HREF parameter needs to be either absolute, or relative to the poster movie (MyGIFImage.mov), not relative to the web page.

What this does is to present the GIF image as a QuickTime movie, so that a mouse click event gets handled by the QuickTime plug-in (or ActiveX control under IE). The "target=myself" parameter tells the plug-in to load the linked movie into the current player.

A simpler method would be to attach your GIF image at the beginning of the movie, embed the movie into the page and set AUTOPLAY to "false". Then a click of the movie will start it playing, with controller also set to FALSE.

--Dave Althoff, Jr.

Feb 15, 2007 4:54 PM in response to Dave Althoff

Hi Dave,

Thanks for your help.

I modified the code and it worked great on both systems except on WinXP - IE. Here is a screen grab, I appreciate your input http://www.inspiringmen.com/rrss/ad/IE_screengrab.gif

As you can see on other systems is looks like it should. Is there anything I should modify in the code to make it look like it does on everyother browser?

<OBJECT CLASSID="clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B"
CODEBASE="http://www.apple.com/qtactivex/qtplugin.cab" width="750" height="441">
<PARAM name="SRC" VALUE="techsupportgif.mov">
<PARAM name="AUTOPLAY" VALUE="true">
<PARAM name="CONTROLLER" VALUE="true">
<PARAM name="LOOP" VALUE="false">
<PARAM name="HREF" VALUE="apple-getamac-tech-support_750x425.mov">
<PARAM name="TARGET" VALUE="myself">
<embed width="750" height="441"
src="techsupportgif.mov"
controller="false"
autoplay="true"
loop="false"
href="apple-getamac-tech-support_750x425.mov"
target="myself"
pluginspage="http://www.apple.com/quicktime">
</embed>
</object>

I used apple's ads as an example on my site. I hope I am not infringing on copyright issues... 😟

Feb 15, 2007 10:58 PM in response to Boss 33

Ah. Well, there are two issues, and I am not entirely sure which one is the real problem.

Look at the code again. The problem is that <embed> does not work in Internet Explorer, and <object> doesn't work right in Mozilla. So you create an <object> to invoke the ActiveX control in Internet Explorer, and within the <object> is the <embed> action that invokes the QuickTime plug-in for every other browser. So the first thing that I notice is that your parameters for the ActiveX object are not the same as your parameters for the plug-in. Specifically, your CONTROLLER parameter is set to TRUE, while in the embed code you have controller set to FALSE. That alone will make the two versions look different. Of course, if the movie dimensions are 750 x 425, then why set the dimensions to 750 x 441 without a controller? Why not set to 750 x 425? Or include the controller and go to 750 x 441 and set controller to TRUE in both places.

The other issue that I see in the screen grab is the little notation that you have to click on the movie to interact with it. That is Microsoft's solution to a patent dispute on embedded controls, and the workaround is to use a JavaScript method that does a document.write to add the embedded object to the page after it loads. I have not played with that method yet, and I can't seem to find the page that talks about it on Apple's site (anyone? anyone?).

Looking at the only place where I see any inconsistency in your code, I'd say it's the mismatched parameters that are getting you. Remember, the <PARAM NAME="parameter" VALUE="value"> section sets up the ActiveX control for IE, while the <EMBED> options control every other browser. So for the most part you want the parameter values to match to get the same behavior on all browsers.

hope that helps...

--Dave Althoff, Jr.

Feb 16, 2007 10:32 AM in response to Dave Althoff

Ok, here's what I did.

1- Downloaded the javascript "ac_quicktime.js" and loaded it into folder called "js".

2- Wrote and called the script below, right before the </head> tag

<script src="http://www.inspiringmen.com/js/ac_quicktime.js" language="JavaScript" type="text/javascript"></script>

3- Inserted the function below in the <body> tag:

<script language="JavaScript" type="text/javascript">
QT WriteOBJECT_HTML('apple-getamac-tech-support750x425.mov', '750', '441', '',
'autoplay', 'true',
'emb#bgcolor', 'black',
'align', 'middle'); </script>

Now as you can see by going to http://www.inspiringmen.com/rrss/ad/ the original (and former) .gif file which I renamed to "techsupportgif.mov" that used to link to the movie ( http://www.inspiringmen.com/rrss/ad/apple-getamac-tech-support_750x425.mov ) is not there anymore.

It seems like I've taken a few steps back and am trying to figure out how to do this using the above format:
<PARAM name="SRC" VALUE="techsupportgif.mov">
<PARAM name="AUTOPLAY" VALUE="true">
<PARAM name="CONTROLLER" VALUE="false">
<PARAM name="LOOP" VALUE="false">
<PARAM name="HREF" VALUE="apple-getamac-tech-support_750x425.mov">
<PARAM name="TARGET" VALUE="myself">

I think I'm moving away from my original idea of having a .gif {link to a} .mov {which finishes by reverting back to a} .gif

At this point can I still do this? If not how can I update my code above to allow for a src and a href to 2 independent .mov?

Feb 16, 2007 11:41 AM in response to Boss 33

The problem with that script is that it does not support the HREF and TARGET parameters, which are the ones you're using to load the second movie.

The simplest way to do it is to go to the first example on the page. What you need to do is create an external JavaScript that will insert the ENTIRE object tag into your file:

function insertMovie{
document.write('<OBJECT CLASSID="clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B">/n');
document.write('WIDTH="www"HEIGHT="hhh"/n');
document.write('CODEBASE="http://www.apple.com/qtactivex/qtplugin.cab">/n');
document.write('<PARAM name="SRC" VALUE="MyGIFImage.mov">/n');
document.write('<PARAM name="AUTOPLAY" VALUE="true">/n');
document.write('<PARAM name="CONTROLLER" VALUE="false">/n');
document.write('<PARAM name="LOOP" VALUE="false">/n');/n');
document.write('<PARAM name="HREF" VALUE="MyMovie.mov">/n');
document.write('<PARAM name="TARGET" VALUE="myself">/n');
ew1 document.write('<embed src="MyGIFImage.mov" >/n');
document.write('width="www" /n');
document.write('height="hhh" /n');
document.write('controller="false"/n');
document.write('autoplay="true"/n');
document.write('loop="false"/n');
document.write('href="MyMovie.mov"/n');
document.write('target="myself"/n');
document.write('pluginspage="http://www.apple.com/quicktime">/n');
document.write('</embed>/n');
document.write('</object>/n');
}

Then include the call to the insertMovie at the point where your movie is supposed to appear on the page.

So you're on the right track, it's just that the JavaScript you are using does not support the href and target parameters that you need to get the behavior that you want.

Hmmm...I just looked at Apple's JavaScript and it looks like it does support these extra tags. So it looks like you can use it, but you have to be sure to include all the tags you need. So it looks like you could do it with something like this in your page:

<script language="JavaScript" type="text/javascript">
QT WriteOBJECTHTML('techsupportgif.mov', '750', '441', '',
'autoplay', 'true',
'controller','false',
'href','apple-getamac-tech-support_750x425.mov',
'target','myself'
'loop','false');
</script>

In other words, you have to pass all of your parameters to the script.

--Dave Althoff, Jr.
Kirk: Thanks for that link. This time I remembered to bookmark it!

Feb 16, 2007 12:39 PM in response to Dave Althoff

I tried the latter option by inserting the
<script src="http://www.inspiringmen.com/js/ac_quicktime.js" language="JavaScript" type="text/javascript"></script>

before the </head> line and had your code below inserted in the <body>

<script language="JavaScript" type="text/javascript">
QT WriteOBJECTHTML('techsupportgif.mov', '750', '441', '',
'autoplay', 'true',
'controller','false',
'href','apple-getamac-tech-support_750x425.mov',
'target','myself'
'loop','false');
</script>

What I got is what you see in http://www.inspiringmen.com/rrss/ad/ page.

I tried your first suggestion by creating a .js file called insertmovie and put the code in it:
function insertMovie{
document.write('<OBJECT CLASSID="clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B">/n');
document.write('WIDTH="www"HEIGHT="hhh"/n');
document.write('CODEBASE="http://www.apple.com/qtactivex/qtplugin.cab">/n');
document.write('<PARAM name="SRC" VALUE="MyGIFImage.mov">/n');
document.write('<PARAM name="AUTOPLAY" VALUE="true">/n');
document.write('<PARAM name="CONTROLLER" VALUE="false">/n');
document.write('<PARAM name="LOOP" VALUE="false">/n');/n');
document.write('<PARAM name="HREF" VALUE="MyMovie.mov">/n');
document.write('<PARAM name="TARGET" VALUE="myself">/n');
ew1 document.write('<embed src="MyGIFImage.mov" >/n');
document.write('width="www" /n');
document.write('height="hhh" /n');
document.write('controller="false"/n');
document.write('autoplay="true"/n');
document.write('loop="false"/n');
document.write('href="MyMovie.mov"/n');
document.write('target="myself"/n');
document.write('pluginspage="http://www.apple.com/quicktime">/n');
document.write('</embed>/n');
document.write('</object>/n');
}

Then before the </head> tag I called the script:
<script src="http://www.inspiringmen.com/js/insertmovie.js" language="JavaScript" type="text/javascript"></script>

And finally in the <body> inserted the code calling it:
<script language="JavaScript"type="text/javascript" >insertmovie();</script>

But still got the same result you see in the link above.

I've got to know what I'm doing wrong here.
P.S. I appreaicate all the info you and Kirk are teaching me.

Feb 16, 2007 6:20 PM in response to Boss 33

http://www.inspiringmen.com/rrss/ad/techsupportgif.mov
http://www.inspiringmen.com/rrss/ad/apple-getamac-tech-support_750x425.mov
Are found on the server so the trouble is in the page code.
Sorry.
I've been awake since 3 AM and have a cold (more troubles). Top it off and I must awake a 4:30 to work a ten hour Saturday.
The error may be in the iframe code but I just can't focus on text at this time.

Feb 17, 2007 10:59 AM in response to QuickTimeKirk

hi Kirk,

Sorry you're not feeling well. I hope you're not reading this and are taking a rest at this point. It sounds like you need it. Best wishes...

To others, I started to get through this issue with this code:


User uploaded file


On http://www.inspiringmen.com/rrss/ad/ you can see that the top one is using a .MOV while the bottom is using a .GIF

The challenge now is to show the controller using IE. For some reason it's missing.

Also, I'm working on turning the movie back into a .gif, your help is appreciated. Except to you Kirk, you really should be on Niquil or something... 😉

Feb 20, 2007 8:42 AM in response to Boss 33

I don't have the JavaScript code in front of me here, but in the page code when you invoke QT WriteOBJECTXHTML() the only attributes I see are "qtnext1=http://www.inspiringmen.com/rrss/ad/newad.GIF" and "T=<myself>". I don't see a 'controller','<true>' in there, which might explain the absence of a controller...

In any case, I think it's a JavaScript code error rather than a QT process error...

--Dave Althoff, Jr.

Feb 22, 2007 8:30 AM in response to Dave Althoff

I'm trying to use the least amount of code on my page.

The output is the same story, GIF -> MOVIE -> GIF -> MOVIE ->GIF but I want to have the randinator there since the movie sizes will be the same. And the gifs as well.

To randomize the first movie, or every movie?

The basic idea would be to put the movie URLs in an array, randomize the array, and then call the array from the embedding code.

Any help?

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

Quicktime and AJAX

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.