Ver Fonte

refactor(player): change @timeupdate to @playing

Casper Dai há 3 anos atrás
pai
commit
9bafd79a84

+ 3 - 3
src/components/external/DevicePlayer/index.vue

@@ -12,8 +12,8 @@
         muted
         @play="onVideoPlay"
         @pause="onVideoPause"
-        @timeupdate="onTimeUpdate"
         @waiting="onVideoWaiting"
+        @playing="onVideoPlaying"
         @error="onVideoError"
       />
       <div class="o-video__mask">
@@ -57,9 +57,9 @@
             </div>
             <div
               class="o-quality-menu__item u-pointer"
-              @click="changeQuality('')"
+              @click="changeQuality('f')"
             >
-              原画
+              超清
             </div>
           </div>
           {{ qualityValue }}

+ 1 - 1
src/components/external/camera/CameraPlayer/index.vue

@@ -12,8 +12,8 @@
         muted
         @play="onVideoPlay"
         @pause="onVideoPause"
-        @timeupdate="onTimeUpdate"
         @waiting="onVideoWaiting"
+        @playing="onVideoPlaying"
         @error="onVideoError"
       />
       <div class="o-video__mask">

+ 7 - 7
src/components/external/player.js

@@ -159,13 +159,6 @@ export default {
       console.log('onVideoPause')
       this.paused = true
     },
-    onTimeUpdate () {
-      console.log('onTimeUpdate')
-      if (this.loading) {
-        this.loading = false
-        clearTimeout(this.$timer)
-      }
-    },
     onVideoWaiting () {
       console.log('onVideoWaiting')
       if (!this.loading) {
@@ -182,6 +175,13 @@ export default {
         }
       }, 10000)
     },
+    onVideoPlaying () {
+      console.log('onVideoPlaying')
+      if (this.loading) {
+        this.loading = false
+        clearTimeout(this.$timer)
+      }
+    },
     onVideoError (e) {
       console.log('onVideoError', e)
       this.destroyPlayer()