Adding a reference to a local video file

Post here questions and problems related to editing and publishing DITA content.
steveinfrance
Posts: 5
Joined: Mon Oct 22, 2012 5:25 pm

Adding a reference to a local video file

Post by steveinfrance »

Hi everyone,

Is there an easy way to add a reference (keyref) that would launch a video file in the webhelp output?

Basically, I've created some screencasts with Camtasia, and I want to link the topic to the relevant mp4 video that is stored on the same server.

Currently in the output it's giving me <span class="xref"> with no link to the file. I've put a keydef in the map file.

Thanks in advance for your help,
Steve
sorin_ristache
Posts: 4141
Joined: Fri Mar 28, 2003 2:12 pm

Re: Adding a reference to a local video file

Post by sorin_ristache »

Hi,

You should add an element <xref> in your DITA topic where you want to insert the link to the video, for example:

Code: Select all

<xref keyref="video">video title here</xref>
and define the key in the map that includes the topic, for example:

Code: Select all

<keydef keys="video" href="videos/video_file.mp4"
format="mp4" processing-role="resource-only" navtitle="some title here"/>
For copying the resource file videos/video_file.mp4 automatically to the output directory of the Webhelp transformation you should add also the .mp4 extension to the list of accepted resource types in the file [Oxygen-install-dir]/frameworks/dita/DITA-OT/lib/org.dita.dost.platform/plugin.properties:

Code: Select all

supported_resource_extensions=.pdf;.swf;.mp4
This should transform the <xref> element into a link in the Webhelp output. The problem is that there is a bug in the DITA-OT tool that runs the DITA transformations (which I reported here) so the link will be created only if you add also the scope="external" attribute to the <keydef> element. If you add this scope attribute you have the side effect of not copying the mp4 resource file anymore to the output directory, so you will have to copy it manually.


Regards,
Sorin
steveinfrance
Posts: 5
Joined: Mon Oct 22, 2012 5:25 pm

Re: Adding a reference to a local video file

Post by steveinfrance »

Hi Sorin,

Thanks for your help and for opening up the bug report.

This is probably a related issue, but I needed to update my keydef href so that it starts with ../../ - otherwise it looks for the mp4 file on the same level.

Thanks,
Steve
Post Reply