autoplay=1 if unnecessary.player.pauseVideo();.?enablejsapi=1 for API control and test across browsers for consistency.If you are experiencing an issue where the sound of a YouTube video continues to play after closing a pop-up modal on your Webflow site, follow these steps to resolve it.
autoplay=1 if unnecessary.
player.pauseVideo(); within the modal close function.
iframe or script attributes related to YouTube embeds. Make sure ?enablejsapi=1 is added to the video URL for API control.
To resolve the issue of a YouTube video continuing to play when a pop-up modal closes, configure your modal interactions to hide and stop the video using both Webflow interactions and YouTube's API with JavaScript. Ensure all video embeds are updated to support these controls by including the necessary query parameters.