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