Reputation: 25
I am trying to add video to the carousel of a webpage but the video is showing and not playing, all the buttons like play/sound/pause/buffering are showing but the video is not playing. The video is only playing if I am making it fullscreen and clicking on the play button. After playing if I am escaping the full-screen mode still it is playing. So how can I include autoplay to avoid playing the video only when I am clicking full screen?
<!-- 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>
Upvotes: 1
Views: 2493
Reputation: 819
You can try using playsinline, it worked for me.
<video playsinline="playsinline" width="1400" autoplay="autoplay" height="400" muted="muted" loop="loop">
<source src="movie.mp4" type="video/mp4">
</video>
Upvotes: 2
Reputation: 1058
Use autoplay
instead of autoplay="autoplay"
Also you have syntax error before height
you are missing double-quote.
<video width="1400" autoplay="autoplay height="400" controls>
Here is working example
<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>
Upvotes: 1
Reputation: 828
You have a missing "!
<video width="1400" autoplay="autoplay" height="400" controls>
would be right
Upvotes: 2