stop youtube embed video javascript code example
Example: javascript stop youtube video
<iframe id="myVideoId" src="https://www.youtube.com/embed/Q63qjIXMqwU?enablejsapi=1"></iframe>
<script>
//stop the video playing like so
document.getElementById("myVideoId").contentWindow.postMessage('{"event":"command","func":"stopVideo","args":""}', '*');
</script>