Browse Source

fix: drawframe

showgao 3 years ago
parent
commit
5823cc4d42
4 changed files with 10 additions and 6 deletions
  1. 5 2
      web/dist/vap.js
  2. 0 0
      web/dist/vap.min.js
  3. 1 1
      web/package.json
  4. 4 3
      web/src/video.ts

+ 5 - 2
web/dist/vap.js

@@ -1345,6 +1345,7 @@
       classCallCheck(this, VapVideo);
       classCallCheck(this, VapVideo);
 
 
       this.events = {};
       this.events = {};
+      this.firstPlaying = true;
       this.customEvent = ['frame', 'percentage', ''];
       this.customEvent = ['frame', 'percentage', ''];
     }
     }
 
 
@@ -1468,6 +1469,8 @@
           video.load();
           video.load();
         }
         }
 
 
+        this.firstPlaying = true;
+
         if ('requestVideoFrameCallback' in this.video) {
         if ('requestVideoFrameCallback' in this.video) {
           this.useFrameCallback = !!this.options.accurate;
           this.useFrameCallback = !!this.options.accurate;
         }
         }
@@ -1662,8 +1665,8 @@
     }, {
     }, {
       key: "onplaying",
       key: "onplaying",
       value: function onplaying() {
       value: function onplaying() {
-        if (!this.firstPlaying) {
-          this.firstPlaying = true;
+        if (this.firstPlaying) {
+          this.firstPlaying = false;
 
 
           if (!this.useFrameCallback) {
           if (!this.useFrameCallback) {
             this.drawFrame(null, null);
             this.drawFrame(null, null);

File diff suppressed because it is too large
+ 0 - 0
web/dist/vap.min.js


+ 1 - 1
web/package.json

@@ -1,6 +1,6 @@
 {
 {
   "name": "video-animation-player",
   "name": "video-animation-player",
-  "version": "1.0.1",
+  "version": "1.0.2",
   "description": "webgl动画特效组件",
   "description": "webgl动画特效组件",
   "main": "dist/vap.js",
   "main": "dist/vap.js",
   "scripts": {
   "scripts": {

+ 4 - 3
web/src/video.ts

@@ -24,7 +24,7 @@ export default class VapVideo {
   private _drawFrame: () => void;
   private _drawFrame: () => void;
   protected animId: number;
   protected animId: number;
   protected useFrameCallback: boolean;
   protected useFrameCallback: boolean;
-  private firstPlaying: boolean;
+  private firstPlaying = true;
   private setBegin: boolean;
   private setBegin: boolean;
   private customEvent: Array<string> = ['frame', 'percentage', ''];
   private customEvent: Array<string> = ['frame', 'percentage', ''];
 
 
@@ -131,6 +131,7 @@ export default class VapVideo {
       video.load();
       video.load();
     }
     }
 
 
+    this.firstPlaying = true;
     if ('requestVideoFrameCallback' in this.video) {
     if ('requestVideoFrameCallback' in this.video) {
       this.useFrameCallback = !!this.options.accurate;
       this.useFrameCallback = !!this.options.accurate;
     }
     }
@@ -282,8 +283,8 @@ export default class VapVideo {
   }
   }
 
 
   onplaying() {
   onplaying() {
-    if (!this.firstPlaying) {
-      this.firstPlaying = true;
+    if (this.firstPlaying) {
+      this.firstPlaying = false;
       if (!this.useFrameCallback) {
       if (!this.useFrameCallback) {
         this.drawFrame(null, null);
         this.drawFrame(null, null);
       }
       }

Some files were not shown because too many files changed in this diff