data() {
return {
options: {},
}
},
created() {
getCourseById(this.userid).then(response => {
let danmakuId = this._getDanmakuId(this.videos[0].videoLink)
this.options = {
video: {
url: this.videos[0].videoLink,
pic: this.videos[0].videoLink + "?vframe/jpg/offset/0"
},
danmaku: {
id: danmakuId,
api: BASE_UTL + "/video/addBarrage/",
token: this.token,
user: this.userid
}
}
setTimeout(() => {
this.dp = this.$refs.player.dp
})
})
Asynchronous initialization video cannot be loaded correctly. Initialization is performed before asynchronous data. If video initialization is also performed asynchronously, an error will be reported and the on-screen comment cannot be loaded normally
TypeError: Cannot read property "map" of undefined
at DPlayer.min.js:1