How To Disable Auto-play For Local Video In Iframe
How to disable auto-play for video when src is from my local pc? I have tried the following, but it
Solution 1:
If you are using HTML5, using the Video tag is suitable for this purpose.
You can use the Video Tag this way for no autoplay:
<video width="320" height="240" controls>
<source src="videos/example.mp4" type="video/mp4">
</video>
To enable auto-play,
<video width="320" height="240" controls autoplay>
<source src="videos/example.mp4" type="video/mp4">
</video>
Solution 2:
Try This Code for disable auto play video.
Its Working . Please Vote if your are done with this
<div class="embed-responsive embed-responsive-16by9">
<video controls="true" class="embed-responsive-item">
<source src="example.mp4" type="video/mp4" />
</video>
</div>
Solution 3:
if you still need to use an iframe, add a sandbox
<iframe width="465" height="315" src="videos/example.mp4" sandbox></iframe>
Solution 4:
What do you think about video
tag ? If you don't have to use iframe
tag you can use video
tag instead.
<video width="500" height="345" src="hey.mp4" />
You should not use autoplay
attribute in your video
tag to disable autoplay.
Solution 5:
Replace the iframe for this:
<video class="video-fluid z-depth-1" loop controls muted>
<source src="videos/example.mp4" type="video/mp4" />
</video>
Post a Comment for "How To Disable Auto-play For Local Video In Iframe"