Blocking embedded media
Example: Blocking an embedded YouTube video
<iframe width="560" height="315" src="https://www.youtube.com/embed/Y7dpJ0oseIA" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe><script type="text/plain" data-cookieconsent="marketing">
(function(embedCode) {
document
.currentScript
.nextElementSibling
.closest(".legalmonster-embed-container")
.innerHTML = embedCode;
})(
// Replace the code between the single quotes
// with your embed code, keeping it on one line.
'<iframe width="560" height="315" src="https://www.youtube.com/embed/Y7dpJ0oseIA" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>'
);
</script>
<div class="legalmonster-embed-container">
<!-- The embedded media will be inserted in this div. -->
</div>Last updated