diff --git a/pages/plugins/live/pull/components/like-button/like-button.vue b/pages/plugins/live/pull/components/like-button/like-button.vue index b6e03e1f..ce352d17 100644 --- a/pages/plugins/live/pull/components/like-button/like-button.vue +++ b/pages/plugins/live/pull/components/like-button/like-button.vue @@ -244,7 +244,6 @@ timingFunction: 'ease-out', delay: 0 // ms }, () => { - console.log('animation finished.') // 完成后事件回调 this.$emit('finished') // 根据propAlone属性决定逐个删除还是一起删除 diff --git a/pages/plugins/live/pull/components/video/video.vue b/pages/plugins/live/pull/components/video/video.vue index 77bbe55b..5f4ce95a 100644 --- a/pages/plugins/live/pull/components/video/video.vue +++ b/pages/plugins/live/pull/components/video/video.vue @@ -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 diff --git a/pages/plugins/live/pull/mixins/mixins.js b/pages/plugins/live/pull/mixins/mixins.js index e4ddb1bc..25e1c7ad 100644 --- a/pages/plugins/live/pull/mixins/mixins.js +++ b/pages/plugins/live/pull/mixins/mixins.js @@ -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)) {