Iframe tag

0

I have a doubt about the iframe tag in html since I have this tag in a modal and whenever I load the page the video that has this tag starts playing without having even opened this modal, any idea about this event? Any way to make it play only when you play it in the btn of the play or only when the modal opens?

<div id="modal{{$filesVideo->id}}" class="modal">
  <div class="modal-content center-align">
    <iframe class="responsive-video" src="{{'../images/video/'.$filesVideo->name}}" frameborder="0" allowfullscreen></iframe>
  </div>
</div>
    
asked by FABIAN AGUILAR 09.01.2018 в 04:03
source

1 answer

0

It is not very difficult to search in Google, from this answer in SO

You must use the <video> tag, less than <iframe> to prevent the autoplay.

<video width="200" height="200" controls>

<source src="{{'../images/video/'.$filesVideo->name}}" type="video/mp4">

</video>
    
answered by 09.01.2018 в 04:49