Skip to content

Instantly share code, notes, and snippets.

@agungf
Created February 27, 2017 12:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save agungf/b5f45718d6cc12bf6ef9e55997ca5cfb to your computer and use it in GitHub Desktop.
Save agungf/b5f45718d6cc12bf6ef9e55997ca5cfb to your computer and use it in GitHub Desktop.
Dacast player code snipper from web App
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 ');
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment