var options = { // controls: 'control', controls: false, preload: 'auto', playsinline: true, poster: "http://shortmeetadmin.oss-cn-beijing.aliyuncs.com/1515394799463", }; var player = videojs('video', options, function onPlayerReady() { videojs.log('Your player is ready!'); this.play(); console.log(this.duration()) //总是 NaN });https://github.com/videojs/vi...http://docs.videojs.com/tutor...
2 回答
慕盖茨4494581
TA贡献1850条经验 获得超11个赞
var player = videojs('my-video');
player.on('loadedmetadata', function () {
var videoLength = player.duration();
console.log(videoLength)
});
添加回答
举报
0/150
提交
取消