diff --git a/pages/course/illustrate.vue b/pages/course/illustrate.vue index d7ea551..5f90fc1 100644 --- a/pages/course/illustrate.vue +++ b/pages/course/illustrate.vue @@ -35,10 +35,11 @@ - +
+ {{videoData}}
@@ -159,7 +160,7 @@ // musicPlay }, created() { - // this.getLive();//获取播放凭证 + // this.getLive();//获取播放凭证 }, //方法 @@ -167,12 +168,14 @@ // 获取数据 getLive(playAuthsss) { //playAuth 是播放凭证 通过后端自己根据api去获取,返回时不知道为什么结束会带有 = 有时候甚至是2个 所以要截取等号 不然不能播放 - var playAuth = playAuthsss.replace(/=/g, ""); + var playAuth = this.playAuth.replace(/=/g, ""); + // var playAuth = playAuthsss this.videoData = { // ...res.video,//视频其他信息 videoId: this.videoId,//阿里云视频id - playAuth: playAuth,//阿里云播放凭证 + playAuth: this.playAuth,//阿里云播放凭证 }; + console.log('到这') this.playAuth = playAuth; this.$forceUpdate(); @@ -350,8 +353,8 @@ this.curId = id if (this.courseInfo.mediaType == 1 && this.courseInfo.media != '') { this.videoId = this.courseInfo.media - this.videoUrl = await this.getVideoPath(this.courseInfo.media) - this.getLive(this.videoUrl) + this.playAuth = await this.getVideoPath(this.courseInfo.media) + this.getLive(this.playAuth) console.log() // this.videoData = { // videoId: this.videoId,//阿里云视频id @@ -456,9 +459,9 @@ export default { checkValue() { console.log(this.videoId, this.videoData.playAuth, "1111888888") if (!this.videoData.playAuth) { - setTimeout(() => { - this.checkValue(); - }, 2000); + // setTimeout(() => { + // this.checkValue(); + // }, 2000); } else { this.getLive(); }