|
楼主 |
发表于 2022-5-30 13:20:15
|
显示全部楼层
大佬帮看一下是否有问题。X版本相同的代码不会有问题 X2和X3版本的都会出现崩溃问题
//获取视频url
getVideoData() {
//逻辑代码
//...
//获取url前先清除上一个播放器
this.$refs.video && this.$refs.video.stop()
//逻辑代码
///...
},
//stop方法
stop(){
this.url = '';
if(this.isIE){
try {
this.$refs.video.Stop();
} catch (e) {}
}else{
if(this.player != null){
try{
this.player.videoClear && this.player.videoClear();
}catch(e){}
this.player.hlsTemp && this.player.hlsTemp.destroy()
}
}
},
//play方法
play(){
//部分逻辑代码
//...
if(this.player == null){
this.player = new ckplayer(videoObject);
}else{
try{
this.player.videoClear&&this.player.videoClear();
}catch(e){
}
this.player.hlsTemp &&
this.player.hlsTemp.destroy()
this.player = new ckplayer(videoObject);
// this.player.newVideo(videoObject)
}
}
//每20s执行一次 getVideoData()方法
|
|