Created
February 27, 2017 12:00
-
-
Save agungf/b5f45718d6cc12bf6ef9e55997ca5cfb to your computer and use it in GitHub Desktop.
Revisions
-
agungf created this gist
Feb 27, 2017 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,28 @@ dacast(_vid_id,"vid_here"); _vid_player = dacast.players[_vid_id]; // console.log(_vid_player.play()); _vid_player.onReady(function(){ console.log('player ready'); // console.log('Step 2'); _vid_player.onPlay(function(){ // console.log('playing video'); check_session() ? console.log('playing video') : console.log('session_expired'); if(sInt == null) sInt = setInterval(function(){ // console.log('checking session: '+ counter++); check_session(); },10000); }); _vid_player.onPause(function(){ if(sInt != null) { clearInterval(sInt);sInt = null; } }); _vid_player.onComplete(() => { alert('anda sudah selesai menonton '); }); });