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

小程序在组件中播放不了 #113

Closed he2014 closed 4 years ago

he2014 commented 4 years ago

代码: Component({ properties: {}, data: {}, methods: {}, ready() { const SVGA = require("./libs/svga.min") let parser = new SVGA.Parser() let canvas = wx.createSelectorQuery().in(this).select("#svgaPlayer") let player = new SVGA.Player(canvas) parser.load("https://cdn.jsdelivr.net/gh/svga/SVGA-Samples@master/angel.svga", function (videoItem) { player.setVideoItem(videoItem); player.startAnimation(); })

}

});

shiyu123 commented 4 years ago

下载的是最新的svga.min.js吗,我项目中可以