本文介绍了字幕未使用WebVTT显示的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

因此,我试图将字幕添加到html5视频中,并找到了WebVTT.我已经对此进行了一些研究,甚至复制了一些示例代码来查看它是否可以工作,但是我没有运气.

So I'm trying to add subtitles to a html5 video and found WebVTT. I've done some research on it and have even copied some example code to see if that'll work and yet I have no luck.

字幕根本不会显示在视频中.

The subtitles just simply don't show up on the video.

这是HTML.

<video id="video"  class="video" controls>
              <source src="solar.mp4" type="video/mp4">
              <source src="client2.ogv" type="video/ogv">
              <source src="solar.webm" type="video/webm">
              <source src="solar.flv" type="video/flv">

              <track label="English Captions" kind="captions" srclang="en" src="english-subtitles.vtt">
        </video>

和测试VTT文件.

WEBVTT

1
00:00:13,00 --> 00:00:16,000
Man did you see that awesome thing like last week -

2
00:00:16,100 --> 00:00:20,100
- and i said wow a lot of people are starting to talk about this.

推荐答案

它在本地不起作用,您需要在服务器上运行它.

It doesn't work locally, you need to run it on a server.

这篇关于字幕未使用WebVTT显示的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

05-25 05:52