Exiting a video in a Webflow portfolio might not automatically stop the sound if the video continues to play in the background. To address this, you can utilize custom JavaScript to stop the video when the Lightbox is closed.
```javascript
<script>
document.addEventListener('DOMContentLoaded', function() {
const lightboxes = document.querySelectorAll('.w-lightbox');
lightboxes.forEach(lightbox => {
lightbox.addEventListener('hidden', function() {
const iframes = lightbox.querySelectorAll('iframe');
iframes.forEach(iframe => {
const src = iframe.src;
iframe.src = src; // This effectively stops the video
});
});
});
});
</script>
```
To prevent videos from continuously playing after closing a Lightbox in Webflow, add custom JavaScript that resets the iframe's source. Implement this by placing the script in the page settings under the custom code section before the </body> tag. Remember to thoroughly test this solution across different devices.