瀏覽代碼

fix: ws逻辑

shuisheng 2 年之前
父節點
當前提交
f9db6da4b1
共有 2 個文件被更改,包括 1 次插入3 次删除
  1. 1 1
      src/hooks/use-push.ts
  2. 0 2
      src/views/pushByCanvas/index.vue

+ 1 - 1
src/hooks/use-push.ts

@@ -135,6 +135,7 @@ export function usePush({ isSRS }: { isSRS: boolean }) {
         } else {
           roomName.value = liveRoomInfo.value?.name || '';
           roomId.value = `${liveRoomInfo.value?.id || ''}`;
+          connectWs();
         }
       }
     },
@@ -327,7 +328,6 @@ export function usePush({ isSRS }: { isSRS: boolean }) {
     damuList,
     liveUserList,
     liveRoomInfo,
-    connectWs,
     addTrack,
     delTrack,
   };

+ 0 - 2
src/views/pushByCanvas/index.vue

@@ -343,7 +343,6 @@ const {
   liveUserList,
   addTrack,
   delTrack,
-  connectWs,
 } = usePush({
   isSRS,
 });
@@ -368,7 +367,6 @@ onMounted(() => {
   initUserMedia();
   initCanvas();
   handleCache();
-  connectWs();
   document.addEventListener('visibilitychange', onPageVisibility);
 });