This project is read-only.

Add the ability to play videos (.mp4, .wmv, .avi) in CHM files


It would be a really nice enhancement for the SandCastle Help File Builder to be able to accept various types of video formats as part of the <mediaLink> tag structure. Especially if the video could be played via clicking on a link embedded in a CHM file.

The <mediaLink> element states in IntelliSense the following: "The media element represents media objects of any type. It is intended as a placeholder for images, audio and video. The rendering program will be responsible to render the referenced object in a reasonable manner. This complex Type is intended as the content model for media referencing elements in the schema." And yet the <mediaLink> tag only accepts <image xlink:href=""/> sub-tag element.

I did some experimentation and found that I could play a video (.mp4) that was created via SnagIt for the web-site version of a SandCastle build. But it does not work for a CHM file. Here is the xml syntax:
    <linkText>Video: How to create code examples</linkText>
BTW, in Windows 8.1, when you use the above <externalLink> syntax in a CHM and try to click on the video link you get the following message: "No apps are installed to open this type of link (ms-its)"


EWoodruff wrote Jul 1, 2014 at 2:25 AM

There may be issues embedding certain file types in CHM files and they may need to be hosted outside the CHM file which is problematic. Other types may be able to be embedded. See this HelpWare Group site topic for info:

There's a high probability that while this may work in Help 1 and website output it will fail in MS Help Viewer. To be integrated properly given the various media types and element formats for media players this is probably better implemented as a build component or an extension of the existing Resolve Media Links component that could interpret various extra attributes on the media element to output the appropriate HTML elements. To be honest, I'm more inclined to just let this get handled through the use of the markup element to embed the appropriate HTML in the conceptual topic.

dkemlage wrote Jul 1, 2014 at 10:25 PM

I did some testing using the link provided to the Helpware Group. Here are my findings:

I used Camtasia Studio to convert the .mp4 video file to the .avi video file. I added the .avi file to the SandCastle project in the \media folder (Build action CONTENT). Then, I used SandCastle to generate the initial CHM. Then, I used FAR, to decompile the SandCastle created CHM into its atomic parts. I edited an .htm document and made sure the following syntax was used:
<img start="FILEOPEN" loop="1" DYNSRC="../media/CreatingCodeExampleProjects.avi">
Finally, I used FAR again to re-compile the atomic parts back into a CHM. When I navigate to the page, the video automatically starts playing. You can right click over the video to bring up context menus to Stop and Play the video. Actually the Play button acts more like a Pause button in that once the video has stopped and you push the Play again the video continued from where it stopped. There are no options for navigating within the video (no Fast Forward or Rewind). It is a bit of a crude experience but it does work.

So my question morphs slightly given this new information. It is possible to play an .avi file in a CHM by using specific syntax of the <img> tag. How can I pass a literal HTML string into a SandCastle Conceptual .aml document? I have tried numerous incarnations of getting SandCastle to accept the above <img> syntax with no luck including this:
<section address="Section1">
    HOW ABOUT THIS 1:<mediaLink start="FILEOPEN" loop="1" DYNSRC="../media/CreatingCodeExampleProjects.avi"/>
     HOW ABOUT THIS 2:<img start="FILEOPEN" loop="1" DYNSRC="../media/CreatingCodeExampleProjects.avi"/>
     HOW ABOUT THIS 3: &lt;img start="FILEOPEN" loop="1" DYNSRC="../media/CreatingCodeExampleProjects.avi"/&gt;
Any suggestions on passing literal HTML syntax into a Conceptual topic? It would be nice to not have to make manual edits with FAR.


EWoodruff wrote Jul 1, 2014 at 11:00 PM

As mentioned above, use a markup element that contains the literal HTML to pass it through to the rendered topic.

dkemlage wrote Jul 1, 2014 at 11:55 PM

Hi Eric,

Thanks for the page link to the markup element. The following MAML code works great:
      <img start="FILEOPEN" loop="1" DYNSRC="../media/CreatingCodeExampleProjects.avi"/>