Go to site navigation | Go to extended navigation | Go to content

by Charles Soto, Tuesday, November 14, 2006

Example 1 – Embedded QuickTime video using the new External Javascript method

This example shows how to embed a QuickTime video in a Stellent Content Server page generated via a contributed Microsoft Word document.

Below is an embedded QuickTime video that will autoplay:

This is the code used to embed it in the page (do not "break" the lines as shown- keep them on one line):

<script src="https://webcms.utexas.edu/sp/groups/public/documents/web_assets/prod75_003281.js" language="JavaScript" type="text/javascript"></script>

<script language="JavaScript" type="text/javascript">QT_WriteOBJECT_XHTML(
'https://webcms.utexas.edu/sp/groups/public/@comm/documents/multimedia/comm_waves_logo_352x240_mov.mov','480','376','',
'qtsrc','rtsp://vod.communication.utexas.edu/JOU/TXNewsWatch/2005Fall/newswatch_10-20-05_b.mp4',
'autoplay','true',
'controller','true');</script>

Be sure to mark the paragraph style as "HTML Code" then set its text effect to "Hidden" (see the Font dialog below):

Microsoft Word Font dialog box

An alternative is a Poster Movie that begins playing when you click on it:

Here's the code:

<script src="https://webcms.utexas.edu/sp/groups/public/documents/web_assets/prod75_003281.js" language="JavaScript" type="text/javascript"></script>

<script language="JavaScript" type="text/javascript">
QT_WriteOBJECT_XHTML('https://webcms.utexas.edu/sp/groups/public/@comm/documents/multimedia/comm_waves_logo_352x240_mov.mov', '480', '376', '',
'href', 'rtsp://vod.communication.utexas.edu/JOU/TXNewsWatch/2005Fall/newswatch_10-20-05_b.mp4',
'autoplay', 'true',
'controller', 'true',
'target', 'myself');
</script>

Note that in both cases, we refer to a single-frame QuickTime movie named "comm_waves_logo_352x240_mov.mov" that is being managed as contributed Stellent content. There are several different sizes, and we choose the closest to the size of window we're displaying.

We are also referring to a contributed Javascript document (prod75_003281.js) and using it as the "src" target for our first <script> tag. Note that if this contributed document's metadata is changed, the web URL could change along with it. So, don't touch that document.

Example 2 – Embedded Flash using the new External Javascript method

Here is an embedded Flash (.swf) movie (again, no line breaks, please):

Here's the code:

<script src="https://webcms.utexas.edu/sp/groups/public/documents/web_assets/prod75_003282.js" type="text/javascript"></script>

<script type="text/javascript">
AC_FL_RunContent('codebase','http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0',
'pluginspage','http://www.macromedia.com/go/getflashplayer',
'quality','high',
'bgcolor','#ffffff',
'width','500',
'height','600',
'name','PMES',
'src','http://communication.utexas.edu/pmes/PMES',
'movie','http://communication.utexas.edu/pmes/PMES');
</script>

Once again, we are using a contributed Javascript document (prod75_003282.js) and referencing it in our code. No touchie!

Dynamic Converter Setup

Setting up Dynamic Converter to recognize this is tricky, but straightforward. We're interested in associating the Word paragraph style "HTML Code" with a DC element (in our example, conveniently named "HTML Code"). In the DC Template Editor, choose Element Setup:

Stellent Dynamic Converter Template Editor Element Setup dialog box

Click the Styles tab and click "New…"

Stellent Dynamic Converter Template Editor New Style dialog box

Type in "HTML Code" exactly (it uses this to match the built-in Word style's name). Click "New…" next to the Associated element pop-up, then type "HTML Code" (or whatever you want to name this element – I suggest you KISS):

Stellent Dynamic Converter Template Editor New Element dialog box

Now, we set up the style matching ranks in the Ranks tab, then clicking "Reset Defaults":

Stellent Dynamic Converter Template Editor Element Setup dialog box, Ranks tab

Click "New…" then type "HTML Code" and select "HTML Code" as the Associated Element in the pop-up:

Stellent Dynamic Converter Template Editor New Rank dialog box

You might as well move it all the way to the top of the Rank listing, if it's not already there. Now, you have to "un-negate" the Hidden text effect by selecting "HTML Code" in this list, then clicking "Advanced…" Select "Hidden" effect, then click "Properties" in this dialog box:

Stellent Dynamic Converter Template Editor Rank Rules dialog box

Select the "Has positive effect" in the Properties dialog box:

Stellent Dynamic Converter Template Editor Effect Properties dialog box

Now, click "Formatting…" in the main DC Template Editor screen. Hilight "HTML Code" in the Elements list, then select the Character tab and click "Effects…" under Text effects:

Stellent Dynamic Converter Template Editor Formatting dialog box

Scroll the Current mappings list and highlight the Hidden effect. Click "Change…"

Stellent Dynamic Converter Template Editor Effects dialog box

Select "HTML" from the popup list:

Stellent Dynamic Converter Template Editor Change Text Effects dialog box

Save the changes you made to this DC template and from now on, you simply need to write HTML into your Word document, set it to the "HTML Code" style, then mark the code as "Hidden" text effect. It will be represented as straight HTML to the Content Server. In our example, it embeds a QuickTime Movie using the QucikTime Player plug-in. You could do the same for embedded Flash videos, etc.

References

Special thanks to "Amyegg" of the Intradoc_Users list on Yahoo.

These URLs were helpful:

http://developer.apple.com/internet/ieembedprep.html
http://www.apple.com/quicktime/tutorials/embed.html

http://www.apple.com/quicktime/tutorials/embed2.html

http://developer.apple.com/documentation/QuickTime/Conceptual/QTScripting_HTML/index.html

http://www.macromedia.com/devnet/activecontent/articles/devletter.html