尝试了两个设置:setLoop, setRepeatCount均无效。有没有其他的方法能够设置动画无限播放呢?
import { PAGInit } from 'libpag-miniprogram';
async onReady() {
this.PAG = await PAGInit({
locateFile: (file) => {
const filePath = '/utils/' + file;
console.log('Trying to load .wasm file from: ', filePath);
return filePath;
}});
wx.createSelectorQuery()
.select('#pag')
.node()
.exec(async (res) => {
const canvas = res[0].node;
const buffer = await loadFileByRequest('xxxx');
const pagFile = await this.PAG.PAGFile.load(buffer);
const pagView = await this.PAG.PAGView.init(pagFile, canvas);
// 这种方式无效
pagView.setLoop(true);
pagView.play();
});