I have a .mp4 video embedded in an iframe tag. I can't figure out how to turn off auto play. I tried everything: autoplay="false", autoplay="0", autoplay='false', autoplay='0' but nothing seems to work. Here's my code:
<div class="embed-responsive embed-responsive-16by9">
<iframe class="embed-responsive-item behind" src='videos/cloud_computing.mp4' width='640' height='360' style='width:640px;height:360px;'></iframe>
</div>
Before this there was a YouTube video (that didn't auto play) and the code looked like this:
<div class="embed-responsive embed-responsive-16by9">
<iframe class="embed-responsive-item behind" src='https://www.youtube.com/embed/v1uyQZNg2vE?enablejsapi=1&html5=1&hd=1&wmode=transparent&controls=1&showinfo=0;rel=0;' width='640' height='360' style='width:640px;height:360px;'></iframe>
</div>
you need to put a <video>
tag round it as it does not know the iframe
is a video therefore autoplay
will never work. Try the below code.
<div class="embed-responsive embed-responsive-16by9">
<iframe class="embed-responsive-item behind">
<video src='videos/cloud_computing.mp4'
width='640' height='360' style='width:640px;height:360px;' autoplay="0">
</video>
</iframe>
</div>
Note
i would use autoplay="0"
and autoplay="1"
as chrome does not recognise autoplay="true"
or autoplay="false"
.