【问题标题】:node-webkit and html5 videonode-webkit 和 html5 视频
【发布时间】:2013-05-31 09:19:35
【问题描述】:

我正在使用 node-webkit 为 PC 开发一个桌面应用程序。当我使用 node-webkit 运行应用程序时,除了 mp4 视频外,一切都很好。弹出 html 5 视频框,但它是纯白色的,并且控件呈灰色显示,就像我提供错误的文件路径并在 chrome 中运行应用程序时一样。我的 index.html 文件的一个示例:

            <div data-role="popup" id="popupVideo" data-overlay-theme="a" data-theme="c" data-tolerance="15,15" class="ui-content">
                <video width="497" height="298" style="max-width:100%;" controls>
                <source src="base/tutorialvideos//General_Tutorial.mp4" type="video/mp4">
                Your browser does not support the video tag.
                </video> 
            </div>




            <div class="ui-btn ui-btn-right">
                <a href="#popupVideo" data-rel="popup" data-position-to="window" data-role="button" data-icon="info" data-inline="true">Tutorial</a>
            </div>

我多次仔细检查了文件路径,并尝试了 /、//、\、\ 的所有组合以确保确定。我尝试使用完整文件路径而不是相对路径,结果相同。

然后,我使用格式转换器将其中一个视频从 .mp4 更改为 .ogv,结果相同。

真正令人好奇的是,我很确定它正在观看视频,因为使用上面发布的代码,控件是半响应式的。我可以在播放和暂停之间切换并拖动滑块。当我将滑块拖到最后时,它会显示视频的确切运行时间,但仍然没有音频或视频。

我突然想到 jquery mobile 可能搞砸了,所以我会发布这个并使用纯 html 5 运行测试。

感谢您提供任何信息。

【问题讨论】:

  • 你可以使用 wcjs-player。更多详情here.

标签: html google-chrome video node-webkit


【解决方案1】:

node-webkit 仅支持开箱即用的专利“免费”编解码器。但是,您可以启用此处描述的 mp4/h264 支持:Using MP3 & MP4 (H.264) using the video & audio tags.

【讨论】:

  • 只需添加@richapps 答案。从 32 位 Chrome 复制 ffmpegsumo.dll 是测试 mp3/mp4 的最快方法。但请注意许可要求。
  • 我将 ffmpegsumo.so 文件(在 Mac 上)从 Chrome 复制到 Node-Webkit,却发现它已经存在。但是 node-webkit 仍然不能播放 mp4 文件。怎么了?
  • 您需要将文件替换为 Chrome 中的文件。 node-webkit自带的文件不支持mp4。
  • 链接似乎已更改为github.com/nwjs/nw.js/wiki/…
猜你喜欢
  • 1970-01-01
  • 2014-01-14
  • 1970-01-01
  • 1970-01-01
  • 2016-08-20
  • 2012-09-12
  • 2015-05-12
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多