优化hls逻辑处理显示

master
于肖磊 2025-12-19 10:42:44 +08:00
parent 7e2340ab24
commit 7f4f7f2902
3 changed files with 14 additions and 2 deletions

View File

@ -244,7 +244,6 @@
timingFunction: 'ease-out',
delay: 0 // ms
}, () => {
console.log('animation finished.')
//
this.$emit('finished')
// propAlone

View File

@ -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

View File

@ -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)) {