Home / Admin / iframe yt 2
Duplicate Snippet

Embed Snippet on Your Site

iframe yt 2

Code Preview
html
<script type="text/javascript">
    var tag = document.createElement('script');
    tag.src = "https://www.youtube.com/iframe_api";
    var firstScript = document.getElementsByTagName('script')[0];
    firstScript.parentNode.insertBefore(tag, firstScript);
    function onYouTubeIframeAPIReady() {
        new YT.Player('player', {
            events: {
                'onStateChange': function(evt) {
                    if (evt.data === YT.PlayerState.ENDED) {
                        document.getElementById('manual-optin-trigger').click();
                    }
                 }
             }
        });
    }
</script>

Comments

Add a Comment