【问题标题】:Video.js Chapter doesn't workVideo.js 章节不起作用
【发布时间】:2015-06-19 17:01:36
【问题描述】:

我已经在网上搜索了几天,但没有解决方案。我知道 Video.js 曾经存在问题,但 apparently 它在 2014 年用 v4.7.0 修复,我正在运行 v4.12.3。我检查了所有内容,找不到我的代码有任何问题。字幕有效,但章节根本不显示。

我的 VTT:(/public/ 目录中的chapters.vtt)

WEBVTT

Chapter 1
00:00:54.000 --> 00:02:46.000
What did you work on at your previous jobs?

Chapter 2
00:02:59.000 --> 00:04:25.000
When did you get started with programming?

Chapter 3
00:04:30.000 --> 00:05:35.000
What is prototypal inheritance?

Chapter 4
00:05:35.001 --> 00:09:48.000
Why is prototypal inheritance better than classical inheritance in JS?

我在 Nginx 中添加了 MIME 类型,文件加载正常。

我的看法:

<video id="video" class="video-js vjs-default-skin vjs-big-play-centered"
       controls preload="auto" width="640" height="428"
       data-setup='{ "playbackRates": [1, 1.35, 1.5] }'
       poster="...path_here">
       <source src="...path_here" type='video/mp4' />
       <track kind="chapters" src="/chapters.vtt" srclang="en" label="Chapters" default="default">
</video>

<link href="//vjs.zencdn.net/4.12.3/video-js.css" rel="stylesheet">
<script src="//vjs.zencdn.net/4.12.3/video.js"></script>
<script src="/js/plugins/video/videojs.ga.min.js"></script>
<script>
var interviewVideo = videojs('video', {}, function() {
      this.ga(); // load the Analytics plugin
    });
</script>

我只尝试了默认,没有默认,章节,章节,VTT 文件中没有章节,VTT 文件中没有小时。什么都没有发生,除非我把它改成字幕。然后一切正常。

考虑在 github 上打开一个问题,但这不是我第一次忽略一些愚蠢的事情。

感谢您的时间和帮助。

【问题讨论】:

    标签: video.js


    【解决方案1】:

    插件有问题:https://github.com/videojs/video.js/issues/2131

    如果需要章节,请使用 4.11。

    【讨论】:

      猜你喜欢
      • 2020-04-25
      • 1970-01-01
      • 1970-01-01
      • 2018-07-07
      • 1970-01-01
      • 2017-04-23
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多