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%;" >
本文介绍如何使用Videogular播放器API实现播放器的状态监控与控制,包括监听播放器准备就绪、获取当前播放状态及控制播放进度。
580

被折叠的 条评论
为什么被折叠?



