ionic下正确使用videogular的$API的姿势

来源:互联网 发布:mac sql 可视化工具 编辑:程序博客网 时间:2024/05/15 07:00

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%;" >

ref:http://stackoverflow.com/questions/33360730/how-do-i-access-the-methods-of-the-video-when-using-videogular

1 0
原创粉丝点击