简体   繁体   English

VideoJs / Javascript | 字幕不起作用

[英]VideoJs / Javascript | Captions not working

我正在使用VideoJs,但字幕有问题-字幕...它们不起作用,有人可以帮助我修复它。以下是示例,请帮助我:/

The error logged to the js console is {name: "ParsingError", code: 0, message: "Malformed WebVTT signature."} , ie the file is not a valid WebVTT captions file. 记录到js控制台的错误是{name: "ParsingError", code: 0, message: "Malformed WebVTT signature."} ,即该文件不是有效的WebVTT字幕文件。 Your captions file is an SRT file. 您的字幕文件是SRT文件。

Although similar, there are differences between the SRT and WebVTT formats. 尽管相似,但SRT和WebVTT格式之间存在差异。 Specifically in your case you'll need to add the 'WEBVTT' header and change the decimal points in the time codes from , to . 特别是在你的情况,你需要从以时间代码加入“WebVTT插入”页眉和改变小数点,. .

WEBVTT

0
00:00:05.100 --> 00:00:05.500
*S

0
00:00:05.500 --> 00:00:05.900
*Su

See https://developer.mozilla.org/en/docs/Web/API/Web_Video_Text_Tracks_Format 参见https://developer.mozilla.org/en/docs/Web/API/Web_Video_Text_Tracks_Format

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM