Custom action after video is completed

Embed library at head or before last body

<script type="text/javascript" src="https://playout.3qsdn.com/player/js/sdnplayer.js"></script>

Embed player

<h1>Video #1</h1>
<p>Some Text</p>
<!-- Player Container #1 -->
<div id="player1" style="width:100%;height:360px;"></div>
<script type="text/javascript">
   var js3qVideoPlayer;
    (function () {
        var _js3qi = setInterval(function () {
            if (typeof js3q != 'undefined') {
                clearInterval(_js3qi);
                js3qVideoPlayer = new js3q({
                    'data-id': '5c3b0910-8850-11e7-9273-002590c750be',
                    'container': 'player1',
                    'jscallback' : 'myPlayerBridge' // Name your Bridge here
                });
                js3qVideoPlayer.init();
            }
        }, 10);
    })();
</script>
<div id="hiddenBox" style="display:none;">
    <a href="#">Download PDF</a>
</div>

JavaScript

<script type="text/javascript">
var timeLimit = 60; // Time after Action should be called
function myPlayerBridge(player, event, data) {
    if(js3qVideoPlayer.getFullPlaybackTime() >= timeLimit) {
        document.getElementById('hiddenBox').setAttribute('style', 'display:block;');
    }
}
</script>

Back to index.