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) 动画。
https://svga.io
Apache License 2.0
954 stars 239 forks source link

onFrame with pauseAnimation will clear canvas #76

Open qizhou23 opened 5 years ago

qizhou23 commented 5 years ago

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)
miiiku commented 3 years ago

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