【发布时间】:2021-03-28 23:35:43
【问题描述】:
我的 video.js 控件没有显示在视频中,而是在视频之外显示了许多不必要的选项,如下面的屏幕截图所示。
我的代码是这样的:
{% block content%}
<style>
#video-js {
max-width:auto;
width:auto;
max-height:auto;
height:auto;
margin:auto;
padding:auto;
background-color: #343A40;
}
</style>
<video
id="video-js"
class="video-js vjs-custom-skin"
controls
preload="auto"
width=""
height=""
data-setup=""
autoplay
>
<source src="http://url.m3u8" type="application/x-mpegURL" />
<source src="http://url.flv" type="video/x-flv" />
<p class="vjs-no-js">
To view this video please enable JavaScript, and consider upgrading to a
web browser that
<a href="https://videojs.com/html5-video-support/" target="_blank"
>supports HTML5 video</a
>
</p>
</video>
<br>
<br>
<script src="https://vjs.zencdn.net/7.10.2/video.min.js"></script>
<script src="https://unpkg.com/browse/@videojs/http-streaming@2.6.0/dist/videojs-http-streaming.js"></script>
{% endblock %}
我怎样才能让这些奇怪的控件消失,而让视频控件正常,例如播放、暂停、静音、音量增大/减小。
【问题讨论】:
-
样式应该进入
<head>。 -
不幸的是它没有帮助解决问题
-
我无法重现您的问题。您是否有一些可能会覆盖视频样式的 CSS?你的 html 的其余部分是什么样的?
标签: javascript css video.js