鍍金池/ 問答/HTML/ video.js無法獲取視頻的總長度或者剩余的時間

video.js無法獲取視頻的總長度或者剩余的時間

clipboard.png

打印出總是nan

clipboard.png

回答
編輯回答
不舍棄

this.currentTime,this.duration是一個api,要調用

myplayer.on("timeupdate",function(){
    console.log(this.currentTime(),this.duration())
})
2017年3月30日 01:37
編輯回答
氕氘氚

current和duration是myplayer這個video對象的屬性,不是事件對象的屬性

2017年11月7日 17:19