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

标签 html video chm

我有 CHM 文件,其中包含 SWF 视频。

enter image description here

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

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

enter image description here

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

enter image description here

您知道如何创建包含内部视频的 CHM 文件吗?为了拥有一个大文件。

最佳答案

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

经过几次当前的尝试,我只能确认 statement Tim Green 已于 2014 年制作:

.. 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.

更多信息链接:

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

<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了解这些行正在做什么的解释。

关于html - 如何将视频文件包含到CHM文件中?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/67308873/

相关文章:

html - CSS 限制边框大小

javascript - 使 <a> 标签悬停改变鼠标样式

android - 在Android中支持对视频文件进行编码/解码

html - td 中的 css 3 图像

java - JSOUP 计数 Map 标签中的总元素数

java - 如何打开可执行jar中的帮助文件

chm - 为什么我的CHM文件搜索功能报 "No topics found"?

delphi - 将帮助文件链接到 Delphi XE2 应用程序 - 除主窗体外一切正常

video - 查找 MJPEG 视频的特定帧是否比查找 h.264 文件更快?

ios - 将 GPUImage 与 AVVideoCompositing 结合使用