浏览代码

fix: 首页切换

shuisheng 2 年之前
父节点
当前提交
df55051803
共有 1 个文件被更改,包括 7 次插入1 次删除
  1. 7 1
      src/views/home/index.vue

+ 7 - 1
src/views/home/index.vue

@@ -197,9 +197,15 @@ async function changeLiveRoom(item: ILive) {
     //   });
     // } else {
     destroyHls();
-    await startHlsPlay({
+    const { width, height } = await startHlsPlay({
       hlsurl: item.live_room.hls_url!,
     });
+    videoToCanvas({
+      videoEl: hlsVideoEl.value!,
+      targetEl: canvasRef.value!,
+      width,
+      height,
+    });
     // }
   } else {
     destroyFlv();