We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
import { Component } from 'react' import { View, Text, Canvas } from '@tarojs/components' import { Parser, Player } from "svgaplayer-weapp"; import "taro-ui/dist/style/components/button.scss" // 按需引入 import './index.scss' export default class Index extends Component { componentDidMount () { this.loadAnimation(); } async loadAnimation() { const parser = new Parser; const player = new Player; await player.setCanvas('#demoCanvas') const videoItem = await parser.load("https://cdn.jsdelivr.net/gh/svga/SVGA-Samples@master/angel.svga"); await player.setVideoItem(videoItem); player.startAnimation(); } render () { return ( <View className='index'> <Canvas type='2d' id='demoCanvas' style={{width: "300px", height: "300px", backgroundColor: "black"}} /> </View> ) } }
The text was updated successfully, but these errors were encountered:
Sorry, something went wrong.
No branches or pull requests
The text was updated successfully, but these errors were encountered: