This commit is contained in:
@fawn-nine
2024-06-19 16:24:56 +08:00
parent de7e4fb7d7
commit 236aad7a70

View File

@@ -35,10 +35,11 @@
<!-- <view v-if="courseInfo.mediaType ==1 && courseInfo.media != ''" style="width: 100%;height: 100%;text-align: center;" v-html="videoHTML">
</view> -->
<view class="container" v-if="courseInfo.mediaType ==1 && courseInfo.media != ''">
<view class="container" >
<div ref="videoContent" @tap="renderScript.handleClick" id="url-player-test"
:videoData="videoData" :change:videoData="renderScript.receiveMsg"></div>
</view>
{{videoData}}
</view>
<!-- <rich-text v-if="courseInfo.content" class="content"
:nodes="formatRichText(courseInfo.content)"></rich-text> -->
@@ -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();
}