我正在尝试创建一个带有.vtt字幕的(.mp4格式)视频。唯一出现在屏幕上的是视频中心的一两条黑线,也就是字幕应该在的地方,而且只有在Chrome上才会出现。例如,它在Edge中运行良好。为什么他们不出现?这些文件被上传到服务器上。
<html>
<head>
<style>
.container {
margin: 0px 0px;
max-width: 500px;
}
</style>
</head>
<body>
<div class="container" id="player">
<video controls crossorigin playsinline poster="poster.png">
<source src="TSR.mp4" type="video/mp4" size="576">
<source src="TSR.mp4" type="video/mp4" size="720">
<source src="TSR.mp4" type="video/mp4" size="1080">
<!-- Caption files -->
<track kind="captions" label="English" srclang="en" src="subtitles/vtt/english.vtt" default>
<track kind="captions" label="Czech" srclang="cz" src="subtitles/vtt/czech.vtt">
<!-- Fallback for browsers that don't support the <video> element -->
<a href="Test Screen Recording.mp4" download>Download</a>
</video>
</div>
<script src="https://cdn.plyr.io/3.4.4/plyr.polyfilled.js"></script>
<script>const player = new Plyr('#player');</script>
</body>
.vtt文件(示例):
WEBVTT
1
00:00:00.000 --> 00:00:03.000
This is a test screen recording. 截图:
发布于 2019-09-04 22:28:07
删除vtt文件中的数字1
https://stackoverflow.com/questions/52759553
复制相似问题