weex-plugin-lottie
这是一个由lottie-web扩展的weex组件。
需要weex
版本 >= 0.16.0
安装
# with npm
$ npm i weex-plugin-lottie --save
# with weex-toolkit
$ weex plugin add weex-plugin-lottie
用法
示例: examples
动画实例有以下主要方法
#play
#stop
##暂停
##setLocationHref(href)
href
:通常传递为location.href
。当在Safari中遇到没有#
符号的URL的遮罩问题时,非常有用。
##setSpeed(speed)
speed
:1是正常速度。
##goToAndStop(value, isFrame)
value
:数字值。isFrame
:定义第一个参数是时间基于的值还是帧基于的(默认为false)。
##goToAndPlay(value, isFrame)
value
:数字值。isFrame
:定义第一个参数是时间基于的值还是帧基于的(默认为false)。
##setDirection(direction)
direction
:1是向前,-1是向反。
##playSegments(segments, forceFlag)
segments
:数组。可以包含2个数值,用作动画的第一帧和最后一帧。或者可以包含一系列数组,每个数组包含2个数值。forceFlag
:布尔值。如果设置为false,它将等待当前段完成。如果为true,则立即更新值。
#setSubframe(useSubFrames)
useSubFrames
:如果为false,将尊重原始AE的fps。如果为true,则每次requestAnimationFrame请求时都会更新中间值。默认为true。