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) 动画。
代码:
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();
})
代码: 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(); })
});