From e3a6dc6e851977a6b7f0b7a30af9a2a44351bccf Mon Sep 17 00:00:00 2001 From: "gao.zhiyuan" Date: Mon, 4 Jul 2022 09:52:14 +0800 Subject: [PATCH] jessibuca.destroy() --- .../client/src/components/videoPlayer/videoPlay.jsx | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/code/VideoAccess-VCMP/web/client/src/components/videoPlayer/videoPlay.jsx b/code/VideoAccess-VCMP/web/client/src/components/videoPlayer/videoPlay.jsx index fd0929f..2cae6d2 100644 --- a/code/VideoAccess-VCMP/web/client/src/components/videoPlayer/videoPlay.jsx +++ b/code/VideoAccess-VCMP/web/client/src/components/videoPlayer/videoPlay.jsx @@ -220,6 +220,7 @@ const VideoPlay = ({ const createJessibuca = async () => { if (videoObj.type != 'yingshi') { try { + // 初始化 推流 // const inviteRes = await IotVideoServerRequest.get(VideoServeApi.invite, { // id: '36011200002002021114', // channel: '36011200581314002900' @@ -234,9 +235,12 @@ const VideoPlay = ({ console.log(error.response); } + if (jessibuca) { + jessibuca.destroy() + } let $container = document.getElementById(containerId); - const jessibuca = new window.Jessibuca({ + const jessibuca_ = new window.Jessibuca({ container: $container, videoBuffer: 0.2, // 缓存时长 isResize: false, @@ -253,8 +257,8 @@ const VideoPlay = ({ forceNoOffscreen: false, isNotMute: false, }); - setjessibuca(jessibuca) - play({ jessibuca }) + setjessibuca(jessibuca_) + play({ jessibuca: jessibuca_ }) } }