HTML 视频无法正常工作

标签 html html5-video

我正在尝试让视频在本地播放,但它不起作用。该文件是“wildlife.mp4”,但是它无法播放,它只是一个空白的视频框?任何帮助将不胜感激,谢谢。

<!DOCTYPE html>
<html>
<head>
<title>video</title>
</head>
<body>
<video width="320" height="240" controls>
<source src="wildlife.mp4" type="video/mp4">
<source src="wildlife.ogg" type="video/ogg">
Your browser does not support the video tag.
</body>
</html>

enter image description here

最佳答案

视频标签未关闭。 如果您希望视频自动播放,请添加自动播放。

 <!DOCTYPE html>
<html>
<head>
<title>video</title>
</head>
<body>
<video width="320" autoplay="autoplay" height="240" controls>
<source src="wildlife.mp4" type="video/mp4">
<source src="wildlife.ogg" type="video/ogg">
Your browser does not support the video tag.
</video>
</body>
</html>

关于HTML 视频无法正常工作,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19938488/

相关文章:

user-interface - 用 Canvas 设计界面

html - 垂直对齐不同高度的元素与顶部/底部边距

html - 现代浏览器的安全字体列表

javascript - 无法附加到源缓冲区

google-chrome - ffmpeg mp4 x264 编码 -> 播放导致 Chrome 和 IE 中的 "pending"导致 10+ 秒延迟

HTML5 track 元素没有 'crossorigin' 属性

javascript - 循环播放的 HTML5 视频在循环播放时出现黑屏

javascript - 如何解决未捕获的类型错误 - 无法读取 null 的属性 'addEventListener'

javascript - Mustache 中的对象列表

html - 如何防止 html5 视频在播放前加载?