Closed hanyitim closed 6 years ago
startAnimationWithRange(range: {location: number, length: number}, reverse: boolean = false); - 播放 [location, location+length] 指定区间帧动画 无语掉了,readme.md 上面没有说明 需要传 fromFrame :true 才会按照帧来算,
你提供一个 Demo,我看看具体问题?
可以发送邮件至 help@svga.io
我自己看懵了,startAnimationWithRange 第三参 传 true 是反转着播放了,以为解决问题了。追问题追到了value-animator,看了ts的写法 顿时懵逼啊
@PonyCui 已经可以了····
//player.js
_doStart(range, reverse, fromFrame) , formFrame 是具体的帧数
在源码把
startAnimationWithRange(range, reverse) {
this.stopAnimation(false);
this._doStart(range, reverse)
}
改成
startAnimationWithRange(range, reverse) {
this.stopAnimation(false);
this._doStart(range, reverse,range.location)
}
就可以了,把location 当成帧数传进去可以行了
又发现了个问题(videoItem.frames:151 ) startAnimationWithRange({location:0,length:150}) ,这个时候是可以很完整的播放完成的, 但是 startAnimationWithRange({location:50,length:150}),修改之后,起始帧是50了,不过缺没有播放到150帧
新的提交中已经修复了这个问题,请拉最新的代码。 谢谢您的发现。
我用npm安装的最新的包并没有解决这个问题啊。。。
@zcoding npm 未发布新版
startAnimationWithRange({location:0,length:20}) 跟 startAnimationWithRange(location:50,length:20)播放的片段是一样的,播放区间都是[0,20], videoItem.frames 是 151