HTML
xxxxxxxxxx
1
<div class="container-fluid mt-3 mb-5">
2
3
<!-- Section -->
4
<section class="bg-primary z-depth-1">
5
6
<!-- Modal -->
7
<div class="modal fade" id="modal1" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel"
8
aria-hidden="true">
9
<div class="modal-dialog modal-lg modal-dialog-centered" role="document">
10
<div class="modal-content">
11
<div class="embed-responsive embed-responsive-16by9 z-depth-1-half">
12
<iframe id="player" class="embed-responsive-item" src="https://www.youtube.com/embed/7MUISDJ5ZZ4" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen></iframe>
13
</div>
14
</div>
15
</div>
16
</div>
17
18
<div class="row no-gutters">
19
20
<div class="col-lg-6 order-md-2">
21
<div class="view">
22
<img class="img-fluid" src="https://mdbootstrap.com/img/Photos/Slides/img%20(152).jpg" alt="Video title">
23
<div class="mask flex-center rgba-black-light">
24
<a id="play" class="btn-floating btn-danger btn-lg" data-toggle="modal" data-target="#modal1"><i class="fas fa-play"></i></a>
25
</div>
26
</div>
27
</div>
28
29
<div class="col-lg-6 mx-auto d-flex align-items-center text-white">
30
<div class="px-4 py-4 py-lg-0">
31
<h3 class="font-weight-normal mb-4">Give a Fresh Design to Your MDB</h3>
32
<p class="mb-0">Fresh fellow even the whole is work outcome them. They original on mountains, drew the
33
support time. The of to graduate. Into to is the to she at return understand every in there transmitting
34
you've he the was and in finger.</p>
35
</div>
36
</div>
37
38
</div>
39
40
</section>
41
<!-- Section -->
42
43
</div>
CSS
1
1
JS
xxxxxxxxxx
1
$('#play').on('click', function (e) {
2
e.preventDefault();
3
$("#player")[0].src += "?autoplay=1";
4
$('#player').show();
5
$('#video-cover').hide();
6
})
7
$('#modal1').on('hidden.bs.modal', function (e) {
8
$('#modal1 iframe').attr("src", $("#modal1 iframe").attr("src"));
9
});
Console errors: 0