I added a custom image in the product view page gallery section. While clicking on the custom image section a popup will throw. On that popup, we can play a wistia video (refer to the attached screenshot).
Now the issue is, while close the popup the video not getting paused, it playing as usual.
My question is how can we pause the wistia video while closing the modal popup.
This is my popup video iframe code:
<div id="modal-overlay" style="display:none;">
<iframe id="wistia-iframe"
align="middle"
type="text/html"
width="100%"
height="100%"
src="<?= $iframeSrc ?>"
frameborder="0"
scrolling="no"
allowfullscreen
webkitallowfullscreen
mozallowfullscreen
oallowfullscreen
msallowfullscreen>
</iframe>
</div>
The iframe src will look like "https://fast.wistia.net/embed/iframe/jf032xg69o?videoFoam=true&wmode=transparent"
I tried the below code to stop the playing video while closing the modal popup, but if I again open the modal popup it starts from starting point.
$('#modal-overlay').on('modalclosed', function() {
$("#modal-overlay iframe").attr("src", $("#modal-overlay iframe").attr("src"));
});
I have tried the below solutions but I am not aware of "wistiaApi". Anyone give me suggestion to achieve this. Thanks in advance!