HTML 视频在 1 分 50 秒后停止播放
我有一个时长 2 分 42 秒的视频。我已确认视频本身可以播放并且没有损坏。视频一直正常播放到 1.50 标记,然后突然停止。
<div class="video-container">
<video controls preload>
<source style="width: 100%; height:50%" src="splitscreen.mp4" type="video/mp4" />
</video>
</div>
.video-container {
width: 100%;
height: 100%;
position: relative;
}
I have a video that is 2 minutes and 42 seconds in length. I have confirmed the video itself plays through and is not corrupted. The video plays fine up until the 1.50 mark and then abruptly stops.
<div class="video-container">
<video controls preload>
<source style="width: 100%; height:50%" src="splitscreen.mp4" type="video/mp4" />
</video>
</div>
.video-container {
width: 100%;
height: 100%;
position: relative;
}
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您可以尝试使用媒体片段,看看是否可以播放整个视频。
将媒体片段添加到媒体 URL,您可以指定要播放的确切部分。要添加媒体片段,请添加#t=[start_time][,end_time]。
You could try using Media Fragments and see if this allows the entire video to be played.
Adding a media fragment to the media URL, you can specify the exact portion you want to play. To add a media fragment, you add #t=[start_time][,end_time].
首先,通过 JS 确认视频的长度:
我在这里所做的就是为您的视频提供一个 ID,声明一个保存
document.getElementById("myVideo")
的变量,然后使用.duration
并发出警报。如果您看到预期的视频长度:那么我相信“controls preload”是您的错误,因为语法不正确(应该是
preload="auto"
),请检查 此处 有关它的详细解释。当然,如果警报中视频的长度确实显示为 1:50,则该视频已损坏。
祝你好运!
First, confirm the video's length through JS:
all I'm doing here is giving your video a ID, declaring a variable which holds
document.getElementById("myVideo")
, then checking it's length by using the.duration
and alerting it. If you see your expected video's length:Then I believe "controls preload" is your error here as the syntax is incorrect (should be
preload="auto"
), check here for great explanation about it.Of-course if the video's length does show 1:50 in the alert, then the video is corrupted.
Best of luck!