Explorar el Código

feat: presentedFrames

showgao hace 4 años
padre
commit
66c1f2b5f2
Se han modificado 1 ficheros con 1 adiciones y 1 borrados
  1. 1 1
      web/src/webgl-render-vap.ts

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

@@ -285,7 +285,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 frame = info && info.presentedFrames > 0 ? info.presentedFrames - 1 : Math.round(timePoint * this.options.fps) + this.options.offset;
     const frameCbs = this.events['frame'] || []
     frameCbs.forEach(cb => {
       cb(frame + 1, timePoint)