How to Stop a YouTube Video When a Modal Closes (Vanilla JS, Bootstrap 5, jQuery)
Three reliable ways to stop or pause an embedded YouTube video when a popup or Bootstrap modal closes, with copy-paste code for vanilla JavaScript, Bootstrap 5, jQuery and the native dialog element.