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

Cannot read property 'requestAnimationFrame' of undefined #137

Open boonook opened 3 years ago

boonook commented 3 years ago

Attention

Cannot read property 'requestAnimationFrame' of undefined

Issue Template

Issue Description(What's your problem)

How To Reappear(How to reappear the issue)

Any Attachment(Provide a sample about your issue)

------ 中文分割线 ------

注意

Issue 模板

请尽量使用英文提交 Issue

uniapp开发微信小程序 Cannot read property 'requestAnimationFrame' of undefined)

webXLing commented 3 years ago

metoo, uniapp开发微信小程序 Cannot read property 'requestAnimationFrame' of undefined)

boonook commented 3 years ago

metoo, uniapp开发微信小程序 Cannot read property 'requestAnimationFrame' of undefined)

可能是你用的库不对

webXLing commented 3 years ago

我用的 小程序代码块里面的 svga.min.js

需要用 https://github.com/svga/SVGAPlayer-Web/blob/mp/build/svga.min.js 吗?

webXLing commented 3 years ago

metoo, uniapp开发微信小程序 Cannot read property 'requestAnimationFrame' of undefined)

可能是你用的库不对

我用的 小程序代码块里面的 svga.min.js

需要用 https://github.com/svga/SVGAPlayer-Web/blob/mp/build/svga.min.js 吗?

webXLing commented 3 years ago

metoo, uniapp开发微信小程序 Cannot read property 'requestAnimationFrame' of undefined)

可能是你用的库不对

我用的 小程序代码块里面的 svga.min.js https://developers.weixin.qq.com/s/57sWDkmq7Eeu

需要用 https://github.com/svga/SVGAPlayer-Web/blob/mp/build/svga.min.js 吗?

boonook commented 3 years ago

metoo, uniapp开发微信小程序 Cannot read property 'requestAnimationFrame' of undefined)

可能是你用的库不对

我用的 小程序代码块里面的 svga.min.js https://developers.weixin.qq.com/s/57sWDkmq7Eeu

需要用 https://github.com/svga/SVGAPlayer-Web/blob/mp/build/svga.min.js 吗?

https://github.com/boonook/nodejs-npm-cmd-cmd_checked/blob/main/src/SVGA/pages/svga/svga.min.js 如果不行你试一下这个

webXLing commented 3 years ago

metoo, uniapp开发微信小程序 Cannot read property 'requestAnimationFrame' of undefined)

可能是你用的库不对

我用的 小程序代码块里面的 svga.min.js https://developers.weixin.qq.com/s/57sWDkmq7Eeu 需要用 https://github.com/svga/SVGAPlayer-Web/blob/mp/build/svga.min.js 吗?

https://github.com/boonook/nodejs-npm-cmd-cmd_checked/blob/main/src/SVGA/pages/svga/svga.min.js 如果不行你试一下这个

image 依然 有概率报错
我看微信小程序 社区里面 也有人反映这个问题 在小程序下 报错 大佬有修复的 计划吗 难道支付宝的树 不是采用这么方案吗

PonyCui commented 3 years ago

不支持除微信以外的小程序

miiiku commented 3 years ago

我也遇到了同样的问题,你可以尝试吧代码放在小程序onReady生命周期中执行试试,我这样做了以后可以正常运用,初步怀疑是获取到的canvas节点有问题造成的调用canvas.requestAnimationFrame报错。