我试图为我的 Angular Web 应用程序使用 rive 动画
<canvas riv="checkmark_icon" width="500" height="500">
<riv-animation name="idle" [play]="animate" (load)="loadAnimation()"></riv-animation>
</canvas>
因此,根据ng-rive npm page 的文档,我遵循了这些步骤。但我在控制台中收到此错误。
最初我以为我是在弹出窗口中加载动画,因此出现了问题,所以我尝试在实际页面上加载动画但没有帮助。
ERROR Error: Could not load animation before running it
at RiveAnimationDirective.moveFrame (ng-rive.js:624)
at MapSubscriber.project (ng-rive.js:618)
at MapSubscriber._next (map.js:29)
at MapSubscriber.next (Subscriber.js:49)
at FilterSubscriber._next (filter.js:33)
at FilterSubscriber.next (Subscriber.js:49)
at SwitchMapSubscriber.notifyNext (switchMap.js:66)
at SimpleInnerSubscriber._next (innerSubscribe.js:10)
at SimpleInnerSubscriber.next (Subscriber.js:49)
at MapSubscriber._next (map.js:35)
从错误中我唯一能理解的是加载动画时出现了一些问题,并且 rive 播放器正在尝试在加载动画之前播放动画。