Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I prevent autoplay in iframe HTML content?

Tags:

html

iframe

I have used iframe with video autoplay stop. But it is always in autoplay mode. I do not want to autoplay. I want to stop autoplay.

My code is below:

 <iframe width="245" height="190" frameborder="0"
     src="Pacers_VS_Lakers_with_LifeWave_Energy_Patches.mp4?autoplay=0&cc_load_policy=1">
 </iframe>
like image 710
user3259990 Avatar asked Mar 30 '14 19:03

user3259990


1 Answers

Just use the video tag instead of iframe:

<video height="100" width="100">
    <source src="some_video_url">
</video>

It will not autoplay itself. It's actually a better option instead of an iframe tag.

The video HTML tag has specific options, see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/Video#attributes

like image 156
Kaif Khan Avatar answered Sep 28 '22 11:09

Kaif Khan