我正在尝试将视频添加到网页的轮播中,但是视频正在显示而不是播放,播放/声音/暂停/缓冲的所有按钮都在显示,但视频不是玩。视频只有在我将其全屏制作并单击"播放"按钮时进行播放。播放后,如果我逃脱了全屏幕模式,它仍在播放。那么,我该如何包括自动播放以避免在我单击全屏时播放视频?
<!-- Wrapper for slides -->
<div class="carousel-inner" role="listbox">
<div class="item active">
<video width="1400" autoplay="autoplay" height="400" controls>
<source src="movie.mp4" type="video/mp4">
</video>
</div>
<div class="item">
<img src="https://placehold.it/1200x400?text=Another Image Maybe" alt="Image">
<div class="carousel-caption">
</div>
</div>
</div>
您缺少一个!
<video width="1400" autoplay="autoplay" height="400" controls>
是正确的
您可以尝试使用PlaySinline,对我有用。
<video playsinline="playsinline" width="1400" autoplay="autoplay" height="400" muted="muted" loop="loop">
<source src="movie.mp4" type="video/mp4">
</video>
使用autoplay
代替autoplay="autoplay"
也有语法错误,在height
您缺少双引号。
<video width="1400" autoplay="autoplay height="400" controls>
这是有效的示例
<video width="400" controls autoplay>
<source src="http://clips.vorwaerts-gmbh.de/big_buck_bunny.mp4" type="video/mp4">
Your browser does not support HTML5 video.
</video>