Pages: 1
Print
Author Topic: Embed Flash Movie in DITA Topics  (Read 13015 times)
severin.foreman
Member

Posts: 47



« on: May 29, 2009, 02:07:19 PM »

XMetaL EE 5.5

Has anyone been able to use XMetaL to embed Flash movies into HTML files generated from DITA topics?

DITA allows the object element, which I can add using the Insert Element list or Insert > Object menu command while in Normal or Tags On view. To get the movie to play in my HTML output, I need to add a param element as a child of object. The param element contains the relative path to the Flash file. The problem is, I cannot find a way to do it in the XMetaL Author interface and the OT installed with XMetaL does not create a param element in the HTML output.

 Does anyone know how to insert the param element inside of object? Or is there another way to set up Flash movies in DITA topics?

Best regards,
Severin
Logged
Derek Read
Program Manager (XMetaL)
Administrator
Member

Posts: 2621



WWW
« Reply #1 on: May 29, 2009, 04:04:32 PM »

The way the DITA customization has been configured the <object> element is rendered as an image, which means that you cannot see its child elements in TagsOn and Normal view or insert them there.

The quick and easy solution is to do this in PlainText view. To treat <object> as a regular element (not an image) so that its children can be seen and inserted will require making modifications to the CTM file for each particular DITA topic type. We'll pass this feedback along to our UI design people.
Logged
severin.foreman
Member

Posts: 47



« Reply #2 on: May 29, 2009, 04:08:47 PM »

Thanks, Derek. It would be very handy to be able to insert <param> elements in Tags On view and also to have a Properties sheet for the common <param> attributes.
Logged
Derek Read
Program Manager (XMetaL)
Administrator
Member

Posts: 2621



WWW
« Reply #3 on: May 29, 2009, 05:32:57 PM »

When I was mucking around with Flash and the DITA OT a while ago (a year?) I found that because the different browsers require different tags, <object> for IE and <embed> for Mozilla-based, this might be tricky to do "right".

The DITA OT by default outputs <object> tags but Adobe recommends the following:

<OBJECT classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0" WIDTH="550" HEIGHT="400" id="myMovieName">
<PARAM NAME=movie VALUE="myFlashMovie.swf">
<PARAM NAME=quality VALUE=high>
<PARAM NAME=bgcolor VALUE=#FFFFFF>
<EMBED href="/support/flash/ts/documents/myFlashMovie.swf" quality=high bgcolor=#FFFFFF WIDTH="550" HEIGHT="400" NAME="myMovieName" ALIGN="" TYPE="application/x-shockwave-flash" PLUGINSPAGE="http://www.macromedia.com/go/getflashplayer"></EMBED>
</OBJECT>

I have not done any searching recently to see if someone in the DITA community (perhaps on one of the Yahoo groups) has come up with an elegant solution for this. There doesn't seem to be any feature requests at SourceForge either. Perhaps you might consider logging a feature request there (as you are probably dealing with this stuff in the real world and might be able to add insight): http://sourceforge.net/tracker/?group_id=132728&atid=725077
Logged
Derek Read
Program Manager (XMetaL)
Administrator
Member

Posts: 2621



WWW
« Reply #4 on: May 29, 2009, 05:40:46 PM »

It might also be worth noting that I was able to (in PlainText) mark up a DITA topic using <object> in such a way as to get a Flash movie to appear in CHM. However...

1) This was at least a year ago and I believe Microsoft is slowly tightening their security on CHM files, so that is one thing that might break this.
2) Because CHM content is displayed using IE (the content pane) only the <object> tags were required in the output.
3) In order for the SWF file to be embedded in the CHM I had to manually move the SWF file into the chm_out folder (or the foldername you are outputting to) and referenced it in the topic using a relative path because the DITA OT by default does not recognize this as an image file to copy over during the build process.

So, it was possible to do CHM containing SWF at some point. The same content worked identically in IE (which makes sense because CHM content is basically the same as the HTML produced by the OT). I don't seem to have any of these files. If I have time to recreate this I'll give it a try at some point.
Logged
Derek Read
Program Manager (XMetaL)
Administrator
Member

Posts: 2621



WWW
« Reply #5 on: May 29, 2009, 05:46:33 PM »

I've just found some old stuff that seems to contradict at least some of what I just posted at least with the state things are in now with browsers. I'll test and put it up as a sample if it turns out to be useful.
« Last Edit: May 29, 2009, 06:25:14 PM by Derek Read » Logged
Derek Read
Program Manager (XMetaL)
Administrator
Member

Posts: 2621



WWW
« Reply #6 on: May 29, 2009, 06:24:57 PM »

OK, here's a set of demo files. They show how it is possible to reference 4 different types of files in the <object> element in a DITA topic and have the DITA OT generate HTML that is viewable in both FireFox (ver 3) and IE (ver 7).

1. Save attached file embedding4types.zip
2. Unzip to an empty folder on your local machine such as: C:\temp\embeddingtest\
3. Launch XMetaL Author Enterprise (I tested with 5.1).
4. Open C:\temp\embeddingtest\objectElementTest.ditamap
5. Select the File menu item Generate Output for DITA Map...
6. Select "Multiple HTML" as the deliverable type and generate the output to the default folder: C:\temp\embeddingtest\multiple_html_out
7. Not all of the referenced file types will have been copied to the output folder because the DITA OT doesn't recognize them (embedded.html is recognized). So, copy the missing files from the folder you created in step 2 into the output folder before opening the file objectelementtest.html in your browser.

You should have the following files in the output folder before you open the topic#.html files in your browser so the browser will find them (the last 4 files listed here):

C:\temp\embeddingtest\multiple_html_out\commonltr.css
C:\temp\embeddingtest\multiple_html_out\commonrtl.css

C:\temp\embeddingtest\multiple_html_out\objectelementtest.html

C:\temp\embeddingtest\multiple_html_out\topic1.html
C:\temp\embeddingtest\multiple_html_out\topic2.html
C:\temp\embeddingtest\multiple_html_out\topic3.html
C:\temp\embeddingtest\multiple_html_out\topic4.html

C:\temp\embeddingtest\multiple_html_out\embedded.html
C:\temp\embeddingtest\multiple_html_outembedded.pdf
C:\temp\embeddingtest\multiple_html_outembedded.swf
C:\temp\embeddingtest\multiple_html_outembedded.txt


For other file formats searching the 'net for the proper type attribute value (basically a mime type) supported by the various browsers will give you the value you need to put into the DITA <object> element's type attribute value (they map 1 to 1 in this case).

Now, to get this coded into your HTML the recommended Adobe way for SWF (by including the <embed> tags) would probably require DITA OT changes. It seems that current browsers don't require that any longer though, at least in my testing with IE7 and FireFox 3, so I guess you'll need to figure out if that's really necessary or not (do you want valid strict XHTML, HTML 4.01, HTML 5, etc...). As for the <param> stuff, my testing seems to suggest that this is not really required, but perhaps there are some <param> settings that control various aspects of the particular file type's viewer that you might wish to control.

* embedding4types.zip (67.28 KB - downloaded 407 times.)
« Last Edit: June 01, 2009, 06:06:20 PM by Derek Read » Logged
severin.foreman
Member

Posts: 47



« Reply #7 on: June 09, 2009, 08:48:07 AM »

Hi Derek,

Thanks very much for your responses and for posting the files. I generated your samples and found that the flash movies played well in Safari, FF and Chrome, but did not play at all in IE 7. When I added the param element (similar to Adobe's recommendations above), the movie played in IE 7. However, adding the param element caused an issue in the other browsers. The movie played, but it no longer streamed; it had to be downloaded before it would run.

I found an article that does a good job of explaining the various elements needed to embed flash movies and proposes a technique to optimize embedded flash movies in several browsers. I'm not sure I want to use the technique discussed, but I will post the link for anyone who is interested.

http://www.alistapart.com/articles/flashsatay

Best regards,
Severin Foreman
Logged
Pages: 1
Print
Jump to:  

email us