masking-danmaku-demo icon indicating copy to clipboard operation
masking-danmaku-demo copied to clipboard

示例代码小问题,barrage-ui源码建议

Open lzr900515 opened this issue 3 years ago • 0 comments

示例代码:src/app.js中:

vContext.drawImage(video, 0, 0, vCanvas.width, vCanvas.height); 应该在barrage.beforeRender中调用更为合理,否则会出现暂停是,拖动进度条,模板为拖拽前画面的模板。

barrage-ui源码 index.js中:

goto方法重置pauseAt的方式,应该根据this.animation来判断是否置空pauseAt。应为暂停状态也可以拖拽,进入另一个时间点的暂停状态。

  goto(progress) {
    this.startTime = Date.now() - progress;
    if (this.animation) {
      this.pauseAt = undefined;
    } else {
      this.pauseAt = progress;
    }
    if (!this.animation) this._render();
  }

lzr900515 avatar May 26 '21 12:05 lzr900515