Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

video not working in bootstrap modal pop up on firefox

I am trying to play video in Modal Pop up, it works fine in Chrome but not in Firefox.

Below is the Code:

<a href="#video" data-toggle="modal" id="clickForVideo">
  Click Me
</a>

==========

Modal poop up code:

==========

<div class="modal fade" id="video" role="dialog" style="display:none;">
  <div class="modal-dialog">
    <div class="modal-content">
      <div class="modal-body modal-video">
        <iframe width="560" height="315" ></iframe>
      </div>
      <button type="button" class="btn modal-close" data-dismiss="modal">X</button>
    </div>
  </div>
</div>

==========

JS code:

==========

$(document).on("click", '#clickForVideo', function() {
  var src = '//www.youtube.com/embed/itTskyFLSS8?feature=player_embedded&autoplay=1';
  $('#video').modal('show');
  $('#video iframe').attr('src', src);
  $(".modal-video").fitVids();
});

==========

like image 896
Ankush Kataria Avatar asked Mar 22 '23 04:03

Ankush Kataria


1 Answers

Adding this css code block in the page you have that modal will sort this issue.

.modal.fade .modal-dialog{transform:none !important;}
like image 101
Arkadas Kilic Avatar answered Apr 01 '23 05:04

Arkadas Kilic