rcrooks
12/11/2015 - 12:23 AM

register to play script - inpage version

register to play script - inpage version

<script type="text/JavaScript">
    var myPlayer;
    /**
     * hides the overlay, unhides the controls, and plays the video
     * this function is called from the registration form in the iframe
     * and that is why it is defined in the global scope
     */
    playVideo = function () {
        // hide the overlay, reveal the controls, play
        myPlayer.addClass('hide-overlay');
        myPlayer.removeClass('hide-controls');
        myPlayer.play();
    }

    videojs('registerToPlay').ready(function(){
        myPlayer = this;
        // show the overlay, hide the controls
        myPlayer.removeClass('hide-overlay');
        myPlayer.addClass('hide-controls');
    });
</script>