From 182aed85616f7ac60d0ffb02e4feac5661b80e0c Mon Sep 17 00:00:00 2001
From: zhangzengfei <zhangzengfei@smartai.com>
Date: 星期三, 08 六月 2022 10:40:21 +0800
Subject: [PATCH] 修复初始化页面

---
 src/components/wasmPlayer/index.vue |   21 ++++++++++++++++++---
 1 files changed, 18 insertions(+), 3 deletions(-)

diff --git a/src/components/wasmPlayer/index.vue b/src/components/wasmPlayer/index.vue
index 43aca2c..44078bd 100644
--- a/src/components/wasmPlayer/index.vue
+++ b/src/components/wasmPlayer/index.vue
@@ -175,6 +175,17 @@
           this.playVideo()
         })
       }
+    },
+    videoUrl: function(newVal, oldVal) {
+      if (newVal !== oldVal) {
+        if (this.player) {
+          this.player.stop()
+        }
+        this.$nextTick(() => {
+          this.player.preloadFlag = 0
+          this.playVideo()
+        })
+      }
     }
   },
   mounted() {
@@ -247,9 +258,10 @@
         _this.canvas.style.cursor = "default"
       })
       _this.canvasData.polygon.forEach(function(v, i) {
-        if (v.location.length === 0) {
+        if (v.location && v.location.length === 0) {
           return
         }
+
         _this.ctx.strokeStyle = "yellow"
         _this.ctx.beginPath()
         _this.ctx.moveTo(v.location[0].x / _this.showProportion, v.location[0].y / _this.showProportionY)
@@ -406,7 +418,8 @@
     },
     setPlayerStatus(stat) {
       this.videoLoading = false
-      this.playerStatus = 1
+      // 鎺у埗鍔犺浇鍚庣殑鎾斁鎸夐挳鐘舵�侊紝瀹炴椂娴佷负鑷姩鎾斁锛岃棰戜负preload
+      this.playerStatus = this.isStream ? 1 : 0
     },
     stopVideo() {
       if (this.player.hPlayer == 0) return
@@ -498,7 +511,9 @@
   width: 100%;
   height: 100%;
 }
-
+#area-canvas {
+  z-index: 1;
+}
 video {
   object-fit: fill;
   width: 100%;

--
Gitblit v1.8.0