如何仅在视频下载完成后才播放?

发布于 2024-12-27 07:09:27 字数 169 浏览 0 评论 0原文

我正在制作将在大屏幕上顺序播放服务器视频的网页。我为 video 标记的 preload 属性设置了“auto”值。我希望视频仅在视频完全下载后才开始播放。有什么办法可以做到这样的事情吗?

在 html5 标准的媒体元素的事件摘要中,我没有找到必要的事件。

I am making web page that will sequentially plays video from server on big screen. I set "auto" value for preload attribute of video tag. I want the video begins to play only when video had downloaded completely. Is there any ways to do such thing?

In the events summary of media elements from html5 standart I didn't find neccessary event.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

我乃一代侩神 2025-01-03 07:09:27

根据 您可以使用 progress 事件。 此处这里是一些如何使用它的示例。每次触发 progress 事件时,检查视频是否已加载,如果已加载,则播放它。

According to this you can use progress event. Here and here are some examples how to use it. Every time when progress event is fired check if video is loaded and if so, play it.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文