Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter jahangeerm

    (@jahangeerm)

    Does anyone know how I can stop this plugin from showing up in on my Post Page. I want it only on my home page.

    Plugin Author MB Creation

    (@mbcreation)

    Hi, here is what you need to put in the editor in order to show a video that will close the popup at the end. Replace XXXXXXXX by your youtube id.

    Have a good day.

    <div id="player"></div>
    
    <script type="text/javascript">// <![CDATA[
        //Load player api asynchronously.
        var tag = document.createElement('script');
        tag.src = "//www.youtube.com/iframe_api";
        var firstScriptTag = document.getElementsByTagName('script')[0];
        firstScriptTag.parentNode.insertBefore(tag, firstScriptTag);
        var done = false;
        var player;
        function onYouTubeIframeAPIReady() {
            player = new YT.Player('player', {
              height: '360',
              width: '640',
              videoId: 'XXXXXXXX',
              events: {
                'onReady': onPlayerReady,
                'onStateChange': onPlayerStateChange
              }
            });
        }
        function onPlayerReady(evt) {
            evt.target.playVideo();
        }
        function onPlayerStateChange(evt) {
            if (evt.data == YT.PlayerState.ENDED && !done) {
                document.getElementById('spmCloseButton').click();
                done = true;
            }
        }
    // ]]></script>
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Auto Close’ is closed to new replies.