Bläddra i källkod

fix: ws逻辑

shuisheng 2 år sedan
förälder
incheckning
f9db6da4b1
2 ändrade filer med 1 tillägg och 3 borttagningar
  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);
 });