Merge branch 'xie'
This commit is contained in:
@@ -34,11 +34,11 @@
|
||||
<view>
|
||||
<!-- <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>
|
||||
</view> -->
|
||||
<!-- {{videoData}} -->
|
||||
</view>
|
||||
<!-- <rich-text v-if="courseInfo.content" class="content"
|
||||
:nodes="formatRichText(courseInfo.content)"></rich-text> -->
|
||||
@@ -53,6 +53,7 @@
|
||||
<!-- <music-play :playData="playData"></music-play> -->
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
// import musicPlay from '@/components/music.vue'
|
||||
import $http from '@/config/requestConfig.js';
|
||||
@@ -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
|
||||
@@ -445,7 +448,9 @@ export default {
|
||||
width: '100%', //容器的大小
|
||||
height: '600rpx', //容器的大小
|
||||
|
||||
}, function(player) { });
|
||||
}, function(player) {
|
||||
console.log('走吗')
|
||||
});
|
||||
this.player = player;
|
||||
player.one('canplay', function() {
|
||||
// console.log('canplay', this.player.tag);
|
||||
@@ -456,9 +461,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();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user