Created
February 27, 2017 12:00
-
-
Save agungf/b5f45718d6cc12bf6ef9e55997ca5cfb to your computer and use it in GitHub Desktop.
Dacast player code snipper from web App
This file contains 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 characters
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