Ver código fonte

fix(Web): frame事件列表为空

hujinliang 4 anos atrás
pai
commit
0e6af8403a
4 arquivos alterados com 3 adições e 3 exclusões
  1. 1 1
      web/dist/vap.js
  2. 0 0
      web/dist/vap.min.js
  3. 1 1
      web/package.json
  4. 1 1
      web/src/webgl-render-vap.ts

+ 1 - 1
web/dist/vap.js

@@ -1923,7 +1923,7 @@
 
         var timePoint = info && info.mediaTime >= 0 ? info.mediaTime : this.video.currentTime;
         var frame = Math.round(timePoint * this.options.fps) + this.options.offset;
-        var frameCbs = this.events['frame'];
+        var frameCbs = this.events['frame'] || [];
         frameCbs.forEach(function (cb) {
           cb(frame + 1, timePoint);
         });

Diferenças do arquivo suprimidas por serem muito extensas
+ 0 - 0
web/dist/vap.min.js


+ 1 - 1
web/package.json

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

+ 1 - 1
web/src/webgl-render-vap.ts

@@ -286,7 +286,7 @@ export default class WebglRenderVap extends VapVideo {
   drawFrame(_, info) {
     const timePoint = (info && info.mediaTime >= 0) ? info.mediaTime : this.video.currentTime
     const frame = Math.round(timePoint * this.options.fps) + this.options.offset;
-    const frameCbs = this.events['frame']
+    const frameCbs = this.events['frame'] || []
     frameCbs.forEach(cb => {
       cb(frame + 1, timePoint)
     })

Alguns arquivos não foram mostrados porque muitos arquivos mudaram nesse diff