优化hls逻辑处理显示
parent
7e2340ab24
commit
7f4f7f2902
|
|
@ -244,7 +244,6 @@
|
|||
timingFunction: 'ease-out',
|
||||
delay: 0 // ms
|
||||
}, () => {
|
||||
console.log('animation finished.')
|
||||
// 完成后事件回调
|
||||
this.$emit('finished')
|
||||
// 根据propAlone属性决定逐个删除还是一起删除
|
||||
|
|
|
|||
|
|
@ -51,6 +51,7 @@
|
|||
muted: false,
|
||||
video_src: '',
|
||||
video_player_show: true,
|
||||
error_msg_count: 0,
|
||||
}
|
||||
},
|
||||
created() {
|
||||
|
|
@ -72,6 +73,7 @@
|
|||
setTimeout(() => {
|
||||
this.video_src = src; // 重新赋值
|
||||
this.video_player_show = true;
|
||||
this.error_msg_count = 0;
|
||||
}, 100);
|
||||
// #endif
|
||||
},
|
||||
|
|
@ -98,7 +100,16 @@
|
|||
// #ifdef H5
|
||||
// 非初次加载错误的, 直播结束
|
||||
if (e.type != 'otherError' || e.details != 'internalException') {
|
||||
this.$emit('ended');
|
||||
// 3次切片报错之后,认为直播结束
|
||||
if (e.details == 'levelLoadError') {
|
||||
this.error_msg_count++;
|
||||
if (this.error_msg_count > 2) {
|
||||
this.error_msg_count = 0;
|
||||
this.$emit('ended');
|
||||
}
|
||||
} else {
|
||||
this.$emit('ended');
|
||||
}
|
||||
}
|
||||
// #endif
|
||||
// #ifdef APP-NVUE
|
||||
|
|
|
|||
|
|
@ -151,6 +151,8 @@ export default {
|
|||
uni.hideLoading();
|
||||
// 如果加载完成了,延迟2秒确定一下直播状态, 有的时候直播状态是正常的也加载成功了,但是获取不到视频流,需要确定一下没有执行error才算是真正的成功
|
||||
this.load_timer = setTimeout(() => {
|
||||
console.log('视频数据加载完成');
|
||||
|
||||
this.retry_count = 0;
|
||||
// 直播状态为正常或者暂停直播了,才认为是正常的加载成功
|
||||
if ([0, 1].includes(this.live_status)) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue