我在角度6中使用Vimeo播放器,想在视频播放时显示当前时间,并且如果在暂停视频时当前时间为10秒,还显示模式弹出窗口。
getCurrentTime()我正在使用
<div class="jumbotron video-stat">
<div class="embed-responsive embed-responsive-16by9" id="video-iFrame"></div>
<i class="fa fa-chevron-up after float-left"></i> <i class="fa fa-chevron-up before float-right"></i>
</div>
ngAfterViewInit() {
var options = {
id: this.passData['url'],
width: 640,
loop: false
};
this.player = new Player("video-iFrame", options);
this.player.setVolume(0);
this.playerReady = true;
}
ngDoCheck(){
if(this.playerReady==true){
this.player.getCurrentTime().then(function(seconds) {
console.log("SEC ",seconds)
}).catch(function(error) {
// an error occurred
});
}
}
我希望这段代码可以连续打印当前时间,但实际上它会陷入无限循环并且浏览器窗口会被挂起