0
我在一個項目中使用ngVideo,我不知道如何從控制器獲取/設置當前時間。從控制器控制ngVideo對象
我的控制器:
'use strict';
angular.module('clientApp')
.config(function($stateProvider){
$stateProvider
.state('video', {
url:'/video',
templateUrl:'views/video.html',
controller:'VideoController as video'
});
})
.controller('VideoController', function($scope, video){
video.addSource('mp4', 'views/unit_1.mp4');
video.currentTime = 10;
console.log('Current Time: ' video.currentTime);
});
我的HTML:
<section class="video" ng-video>
<video vi-screen></video>
<section vi-feedback>
<ul>
<li>Time: {{currentTime}}s/{{duration}}s</li>
<li>Volume: {{volume}}</li>
<li>Buffered: {{buffered}}%</li>
<li>Loading: {{loading}}</li>
<li>Playing: {{playing}}</li>
</ul>
</section>
</section>