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_ }) } }