| (function (window){ |
| |
| var bodymovinjs = {}; |
| |
| function play(animation){ |
| animationManager.play(animation); |
| } |
| function pause(animation){ |
| animationManager.pause(animation); |
| } |
| function togglePause(animation){ |
| animationManager.togglePause(animation); |
| } |
| function setSpeed(value,animation){ |
| animationManager.setSpeed(value, animation); |
| } |
| function setDirection(value,animation){ |
| animationManager.setDirection(value, animation); |
| } |
| function stop(animation){ |
| animationManager.stop(animation); |
| } |
| function moveFrame(value){ |
| animationManager.moveFrame(value); |
| } |
| function searchAnimations(){ |
| animationManager.searchAnimations(); |
| } |
| function registerAnimation(elem){ |
| return animationManager.registerAnimation(elem); |
| } |
| function resize(){ |
| animationManager.resize(); |
| } |
| function start(){ |
| animationManager.start(); |
| } |
| function goToAndStop(val,isFrame, animation){ |
| animationManager.goToAndStop(val,isFrame, animation); |
| } |
| function setSubframeRendering(flag){ |
| subframeEnabled = flag; |
| } |
| function loadAnimation(params){ |
| return animationManager.loadAnimation(params); |
| } |
| |
| bodymovinjs.play = play; |
| bodymovinjs.pause = pause; |
| bodymovinjs.togglePause = togglePause; |
| bodymovinjs.setSpeed = setSpeed; |
| bodymovinjs.setDirection = setDirection; |
| bodymovinjs.stop = stop; |
| bodymovinjs.moveFrame = moveFrame; |
| bodymovinjs.searchAnimations = searchAnimations; |
| bodymovinjs.registerAnimation = registerAnimation; |
| bodymovinjs.loadAnimation = loadAnimation; |
| bodymovinjs.setSubframeRendering = setSubframeRendering; |
| bodymovinjs.resize = resize; |
| bodymovinjs.start = start; |
| bodymovinjs.goToAndStop = goToAndStop; |
| |
| function checkReady(){ |
| if (document.readyState === "complete") { |
| clearInterval(readyStateCheckInterval); |
| //setTimeout(searchAnimations,3000); |
| searchAnimations(); |
| } |
| } |
| |
| bodymovinjs.checkReady = checkReady; |
| |
| window.bodymovin = bodymovinjs; |
| |
| var readyStateCheckInterval = setInterval(checkReady, 100); |
| |
| }(window)); |
| |
| //window.onkeyup = keyActive; |