问题描述
HTML
<!DOCTYPE HTML>
<html>
<head>
<link rel="stylesheet" href="styles.css">
</head>
<body>
<video controls autoplay>
<source src="./test.mp4" type="video/mp4"/>
<track default kind="captions" srclang="en" label="English" src="./test.vtt"/>
</video>
</body>
</html>
CSS
.yellowish {
background-color: blue;
color: yellow;
}
.redcolor {
background-color: white;
color: red;
}
VTT
WEBVTT
00:00:00.000 --> 00:00:03.000
<c.yellowish>This text should be yellow.</c> This text will be the default color.
00:00:03.000 --> 00:00:06.000
<c.redcolor>This text should be red.</c> This text will be the default color.
我将它们托管在带有node.js的简单http服务器上,并在Chrome和Firefox上进行了尝试。 他们没有显示颜色。 我试过在vtt文件中包含样式,但它也不起作用。 大小和颜色似乎无法在Firefox和Chrome中使用。 对准不适用于铬。 所有其他webvtt功能均可正常运行。 我是否应该为此使用任何前端框架? 它可以完美地在YouTube上运行。(1:30 to 1:40)
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)