controller:
$scope.API = null;
$scope.onPlayerReady = function ($API) {
$scope.$API = $API;
console.log("API____:"+$scope.$API.currentState);
}
$scope.watchTime = function ($currentTime,$duration) {
var currentTime = Math.round($currentTime);
console.log("watchTIme____"+currentTime);
if(currentTime>=10){
console.log("STOP-------");
$scope.$API.play();
}
}
html:
<videogular crossorigin="anonymous" vg-theme="config.theme.url" vg-player-ready="onPlayerReady($API)" vg-complete="onCompleteVideo()" vg-update-time="watchTime($currentTime,$duration)" frameborder="0" width="560" height="315" style="position:absolute;top:0;left:0;width:100%;height:100%;" >