状态更新之后逻辑处理一下

master
于肖磊 2025-12-17 11:03:56 +08:00
parent 3c074a84f4
commit b15ee86448
1 changed files with 10 additions and 0 deletions

View File

@ -297,6 +297,16 @@ export default {
* @param {number} status 直播状态
*/
socket_live_status(status) {
// 当前直播状态为1时说明直播已经开始了历史状态为2说明直播刚才暂停了所以需要重新连接避免没有连接导致直播中断
if (status === 1 && this.live_status == 2) {
this.ended_timer = setTimeout(() => {
// 在定时结束后尝试重新连接
if (this.$refs.liveVideo) {
this.$refs.liveVideo.reload_video();
}
}, this.live_room_reconnect_interval_time * 1000);
}
// 定时任务创建后,更新直播状态
this.live_status = status;
}
}