如何将视频文件包含到 CHM 文件中?

How to include video file into CHM file?

我有 CHM 个文件,里面有 SWF 个视频。

我想用 MP4 转换它并创建新的 CHM 文件。

已转换,工作正常。但是我找不到像原来那样将视频文件包含到 CHM 中的任何程序。例如,我试过 HTML Help Workshop。它会创建一个小 CHM 并在其旁边保留视频文件。

另一个程序htm2crm 做一个大文件(右)。但是文件内部的路径不正确(左)。

您知道如何使用内部视频创建 CHM 文件吗?为了有一个大文件。

简短的回答是 - 我不知道现在有任何应用程序可以使用集成的 .mp4 视频。

经过目前的几次尝试,我只能确认 Tim Green 在 2014 年已经做出的 statement

.. CHM now only permits embedding of SWF video files. All other video file formats must be external to the CHM, otherwise they won't play.

请注意以下引用自 About using video files

的提示

Use online video services in CHM. Help+Manual handles this so that the online site is only accessed when the user actually clicks on the preview image to start the video.

Local video formats will always cause problems in CHM files for at least some of your users and should be avoided.

Since the termination of Flash support, Microsoft CHM files no longer support embedding for any video formats. MP4 video files can be embedded in Windows eWriter eBooks. All other video files must be distributed with your help as separate files.

Link 了解更多信息:

对于特殊情况,我记得一些老东西将视频文件留在帮助文件之外,并使用脚本来引用它们。在您的帮助项目中包含大型视频文件可能会产生巨大的已编译帮助文件。有时您可能还需要更新这些文件。

<html>
    <head>
        <title>Example link to video</title>
        <script type="text/javascript">
            <!--

function GetCurrDir() {

  // This function gets the absolute path to the directory that contains the help file.

  var X, Y, sl, a, ra, dir, dir2;

  ra = /::/;
  a = location.href.search(ra);
  if (a <= 0) return("");
  X = 0;
  ra = /:/;
  a = location.href.search(ra);
  if (a == 2) X = 14; else if (a > 2) X = a+1;
  sl = "\";
  Y = location.href.lastIndexOf(sl);
  dir = location.href.substring(X, Y);
  dir2 = unescape(dir);
  return(dir2 + "\");
}


function playVideo(theVideo) {
  // Get the absolute path to the current help directory.

  var path =  GetCurrDir();
  // Make a new Media Player control.
  var control = "<object id='mediaPlayer' " +
                "classid='CLSID:22d6f312-b0f6-11d0-94ab-0080c74c7e95' " +
                "type='application/x-oleobject'>" +
                "<param name='fileName' value='"+ path + theVideo + "'>" +
                "<param name='autoStart' value='true'>" +
                "<param name='showControls' value='true'>" +
                "</object>" +
                "<p><a href='JavaScript:history.back()'>Go back</a></p>";
            
  // Add the new control to the page.
  document.write(control);
 
}

//-->
        </script>
    </head>
    <body>
    <h1>Test case for video</h1>
    <h2>Video 1</h2>
    <p>Lorem ipsum dolor sit amet, consetetur sadipscing elitr.</p>
    <!-- Clicking this image passes the name of the required video file to the playVideo function above. -->
    <a href="JavaScript:playVideo('external-files/HTMLHelp-CHM.mp4')"><img src="../images/extlink.gif" /></a>
    </body>
</html>

请参阅 Microsoft Docs Example: Link to a File Outside of Your Help System 了解这些行的作用。