This commit is contained in:
2024-07-01 14:39:53 +08:00
parent 3fe52975b5
commit 3b3cc95f9f

View File

@@ -21,6 +21,7 @@
v-if="courseInfo.mediaType == 1 && courseInfo.media != ''"
>
<div
:change:isClose="renderScript.receiveClose"
ref="videoContent"
@tap="renderScript.handleClick"
id="url-player-test"
@@ -48,6 +49,7 @@ export default {
data() {
return {
isFullScreen: false,
isClose: false,
playData: {},
Leve1: [],
Leve2: [],
@@ -143,13 +145,17 @@ export default {
//方法
methods: {
async initVideo(data) {
this.isClose = true;
this.videoContext = null;
this.videoContext = uni.createVideoContext("myVideo");
this.videoId = data.videoId;
this.playAuth = await this.getVideoPath(data.videoId);
this.isClose = false;
await this.getLive(this.playAuth);
},
async initAudio() {},
async initAudio() {
this.isClose = true;
},
getLive(playAuthsss) {
//playAuth 是播放凭证 通过后端自己根据api去获取返回时不知道为什么结束会带有 = 有时候甚至是2个 所以要截取等号 不然不能播放
var playAuth = this.playAuth.replace(/=/g, "");
@@ -485,7 +491,16 @@ export default {
},
methods: {
receiveClose(newValue, oldValue, ownerVm, vm) {
// //数据变化
if (this.player&&this.isClose) {
this.player.dispose()
this.player = null
}
},
handleClick(event, ownerInstance) {
console.log('event at line 165:', event)
// this.player.on('ready',function(){