This worked for me to pause the Bootstrap carousel when a native HTML5 video is playing and play it again when a video is paused or done playing. I'm a total JS novice but I searched around and strung a few things together. I may have made a mistake (likely) but it works for me.
I am not calling videos by IDs because I want the action to work on any video playing in the carousel. I have a few in my case.
Note to change the ID of the carousel to match yours.
<script>
$('video').on('play', function (e) {
$("#portfolioCarousel").carousel('pause');
});
$('video').on('stop pause ended', function (e) {
$("#portfolioCarousel").carousel();
});
</script>
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…