引入公共js文件:
<script src="js/svga.min.js"></script>
html:
<div id="canvas"></div>
js:
var player =new SVGA.Player('#demoCanvas');
var parser =new SVGA.Parser('#demoCanvas');
parser.load('../img/action.svga', function(videoItem) {
player.setVideoItem(videoItem);
player.startAnimation();
})
网友评论