From e48ef997c03b49c8090970f5fbb29ce80b0ac6df Mon Sep 17 00:00:00 2001
From: 64850858 <648540858@qq.com>
Date: 星期三, 14 七月 2021 15:57:39 +0800
Subject: [PATCH] 更换播放器, 修正和优化sql脚本,

---
 web_src/src/components/dialog/easyPlayer.vue |   40 +++++++++++++++++++++++++---------------
 1 files changed, 25 insertions(+), 15 deletions(-)

diff --git a/web_src/src/components/dialog/easyPlayer.vue b/web_src/src/components/dialog/easyPlayer.vue
index f6a7b47..1b0ed21 100644
--- a/web_src/src/components/dialog/easyPlayer.vue
+++ b/web_src/src/components/dialog/easyPlayer.vue
@@ -1,7 +1,5 @@
 <template>
-    <div id="player">
-        <div id="easyplayer"></div>
-    </div>
+  <div id="easyplayer"></div>
 </template>
 
 <script>
@@ -12,36 +10,48 @@
             easyPlayer: null
         };
     },
-    props: ['videoUrl', 'error', 'hasaudio'],
+    props: ['videoUrl', 'error', 'hasaudio', 'height'],
     mounted () {
+      let paramUrl = decodeURIComponent(this.$route.params.url)
        this.$nextTick(() =>{
-           console.log("鍒濆鍖栨椂鐨勫湴鍧�涓�: " + this.videoUrl)
-            this.easyPlayer = new WasmPlayer(null, 'easyplayer', this.eventcallbacK)
-            this.easyPlayer.play(this.videoUrl, 1)
+          if (typeof (this.videoUrl) == "undefined") {
+            this.videoUrl = paramUrl;
+          }
+          console.log("鍒濆鍖栨椂鐨勫湴鍧�涓�: " + this.videoUrl)
+          this.play(this.videoUrl)
         })
     },
     watch:{
         videoUrl(newData, oldData){
-            this.easyPlayer.destroy()
-            this.easyPlayer = new WasmPlayer(null, 'easyplayer', this.eventcallbacK)
-            this.easyPlayer.play(newData, 1)
+            this.play(newData)
         },
         immediate:true
     },
     methods: {
         play: function (url) {
-            this.easyPlayer = new WasmPlayer(null, 'easyplayer', this.eventcallbacK)
+          console.log(this.height)
+            if (this.easyPlayer != null) {
+              this.easyPlayer.destroy();
+            }
+            if (typeof (this.height) == "undefined") {
+              this.height = false
+            }
+            this.easyPlayer = new WasmPlayer(null, 'easyplayer', this.eventcallbacK, {Height: this.height})
             this.easyPlayer.play(url, 1)
         },
         pause: function () {
-            this.easyPlayer.destroy();
+          this.easyPlayer.destroy();
+          this.easyPlayer = null
         },
         eventcallbacK: function(type, message) {
-            console.log("player 浜嬩欢鍥炶皟")
-            console.log(type)
-            console.log(message)
+            // console.log("player 浜嬩欢鍥炶皟")
+            // console.log(type)
+            // console.log(message)
         }
     },
+    destroyed() {
+      this.easyPlayer.destroy();
+    },
 }
 </script>
 

--
Gitblit v1.8.0