If you are using Bootstrap modals and have Youtube or Vimeo videos inside of them, you can use js to auto play/pause the video when the modal is opened/closed.
There are three options below.
- Vimeo using the Player SDK to pause/play
- Youtube by removing/adding the src when closing and and adding &autoplay=1 when opening
- Youtube by using the YouTube Player API, but you have to add the video via js to control it with the API