Adding Video files link to CHM

Topics: Developer Forum
Apr 25, 2008 at 8:26 PM
Hey Guys,

I am using sandcastle version of 2.4.1100.00 to generate User manual chm file for my test project but I am not able to embedded or add a link to video file to the chm. Could you please let me know whether this is possible using sandcastle or not?

Thanks,
Ambuj
Coordinator
Apr 25, 2008 at 10:58 PM
Are you putting the HTML to display the video in the XML comments or in an HTML file included as additional content? If you're including the HTML in the XML comments, it's possible the tag (i.e. <object) isn't one of the ones it passes through when transformed so it would need to be added to the Sandcastle transformation. If it's just in an additional content HTML page, I would guess that it should work the same as it would if you loaded the page directly in the browser provided the path to the video file is correct. Can you post an example of the HTML you are using to embed and/or link to the video?

Eric
Apr 28, 2008 at 3:24 PM
Hi Eric,

I have added a simple clock.wmv to the solution and adding following lines to the media.xml to add a media link to project and then I am adding a media link to the document xml which I would like to get converted to chm page. This is the same steps I took to add a image file into a chm page and it worked fine, so I was trying to add video file in the similar manner. I would appreciate if you could let me know what I need to do to add video.

Adding clock.wmv to media.xml

<item id="DAAF130A-88DE-4682-A7BC-D12F42C0E42E">
<image file="clock.avi">
<altText>clock</altText>
</image>
</item>


Adding media link on page

<mediaLink>
<caption>Clock.</caption>
<image xlink:href="DAAF130A-88DE-4682-A7BC-D12F42C0E42E"/>
</mediaLink>









EWoodruff wrote:
Are you putting the HTML to display the video in the XML comments or in an HTML file included as additional content? If you're including the HTML in the XML comments, it's possible the tag (i.e. <object) isn't one of the ones it passes through when transformed so it would need to be added to the Sandcastle transformation. If it's just in an additional content HTML page, I would guess that it should work the same as it would if you loaded the page directly in the browser provided the path to the video file is correct. Can you post an example of the HTML you are using to embed and/or link to the video?

Eric


Coordinator
Apr 28, 2008 at 9:34 PM
Edited May 11, 2008 at 6:34 PM
Images are always rendered using an img tag with a src attribute specifying the image file. To view videos with it, it needs to render a dynsrc attribute instead but the component doesn't support that. What you can do is modify the Sandcastle transformation to support HTML tags. That way, you can use whatever you want including object tags if that makes more sense for displaying the video. To do that, edit the main_conceptual.xsl file found in C:\Program Files\Sandcastle\Presentation\VS2005\transforms (assuming the VS2005 style, subsitute Prototype or Hana for the other two).

[Edited 05/11 - Removed solution (see below)]

This passes through any HTML tag. Now you can specify the image or video as you normally would in a standard HTML web page. For example:

<p/><b>My Video:</b> <img dynsrc="../Media/Copy Files XP.AVI" />

Note that you need "../" in front of the video path so that it goes up one level to find the media folder. Since the image file isn't referenced in the usual fashion, you'll need to add it to the project as additional content so that it is copied to the .\Media folder. This is done using the AdditionalContent property in the Sandcastle Help File Builder. If you are using your own script or another tool, the procedure will vary.

Eric
Coordinator
May 11, 2008 at 6:36 PM
My original pass-through solution based on the way the reference build works is not a good idea as it breaks MAML table support due to the conflicting element names.  As such, I have removed it from the post above.  For a better solution, see http://www.codeplex.com/Sandcastle/WorkItem/View.aspx?WorkItemId=2174.

Eric