svga / SVGAPlayer-Web

Similar to Lottie. Render After Effects / Animate CC (Flash) animations natively on Android and iOS, Web. 使用 SVGAPlayer 在 Android、iOS、Web中播放 After Effects / Animate CC (Flash) 动画。

Home Page:https://svga.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

onFrame with pauseAnimation will clear canvas

qizhou23 opened this issue · comments

onFrame with pauseAnimation will clear canvas

onFrame和pauseAnimation一起用会清空画布

this.parser.load('../../static/asset/smash.svga', (videoItem) => {
                this.player.setVideoItem(videoItem);
});
setTimeout( () => {
                this.player.startAnimationWithRange({location: 0, length: 21})
                this.player.onFrame((res) => {
                    if (res === 10) {
                        // canvas will clear in this step
                        this.player.pauseAnimation();
                    }
                })
}, 1000)
  • use import
  • 导入方式:import

尝试把clearsAfterStop 设置为false再试试。