老师,请教一下,你写的getTime()函数,
getTime() {
let _this = this;
let ele = document.getElementById(“video”);
_this.section.time = parseInt(ele.duration, 10);
}
如果用jquery要怎么写呢?
我试过写成
getTime() {
let _this = this;
let ele = $("#video");
_this.section.time = parseInt(ele.duration, 10);
}
结果不能正常获取得到时长,谢谢!