<iframe>s might save cookies or do other kinds of tracking. This isn't allowed under GDPR law without prior consent from the user. A “click-to-play” solution helps with this situation.
npm install @mvsde/iframe-click-to-play
Installation with a CDN
Use this for the widest browser support.
<script src="https://unpkg.com/@mvsde/iframe-click-to-play" defer></script>
Use this to support only modern browsers which understand ES Modules ↗.
<script src="https://unpkg.com/@mvsde/iframe-click-to-play/dist/iframe-click-to-play.esm.js" type="module"></script>
Take a look at the repository readme ↗ or the source code for the demos: