Programmatic Animation Control | Introducing SVGator’s Player JS API (Link to LIVE Demo)
Tags: javascript, api, svg, animation
Published: 2022-04-05 14:31:31

We’d like you to meet SVGator’s newest feature: [Player JS API](https://www.svgator.com/help/getting-started/svgator-player-js-api) – an event driven interface that gives you full-scale control over SVG animations created with our online animator. It is designed to be a command center that any digital creator who knows their way around basic coding can use to take programmatic animation to the next level. 

SVGator is an [SVG animation tool](https://www.svgator.com/svg-animation-tool) that has been centered around opening up the world of motion graphics to artists with little to no code writing skills. The natural move forward was to circle back to the crew that makes no-code tools possible: developers! The Player API is made to help developers do what they do best: solve problems using the most efficient methods (both time and effort-wise). 

Check out our [LIVE Demo](https://www.svgator.com/help/getting-started/svgator-player-js-api) and then read Player JS API’s documentation to explore all the ins and outs of this new way of controlling web/mobile animations exported from SVGator.

Here’s a brief look at SVGator JS API’s properties, methods and the event interface you can have control over:

## Player Properties

player.currentTime
player.duration
player.hasEnded
player.isAlternate
player.isPlaying
player.isRollingBack
player.iterations
player.state
player.totalTime

## Available Player Methods
 
Each player.method() call returns the player API object itself.


.play()
.pause()
.restart()
.reverse()
.toggle()
.stop()
.ready(callback)
.seek(offsetPercent)
.seekBy(offsetMs)
.seekTo(offsetMs)
.destruct()

## Available Player Events

play
pause
restart
reverse
stop
end
keyframe

Note: The first 5 events are triggered from user actions as well, not only from API calls (i.e. if the animation starts on click).

If you’re looking to create an engaging user experience, the tool’s settings for [interactive animation](https://www.svgator.com/interactive-svg-animation) are a considerable asset. But if you are aiming for a higher complexity and a broader range of interaction for your graphics, programmatic animation is the way to go. 


{% embed https://www.youtube.com/watch?v=CqaF7Fw2CFg %}

## What next?


Check out the basics on how to [animate programmatically](https://www.svgator.com/help/getting-started/animate-programmatically) and learn more about how to access the Player object and how to synchronize events.

Find out how to [trigger an SVG animation manually](https://www.svgator.com/help/getting-started/trigger-the-svg-animation-manually-using-javascript) using JavaScript.

[Start your next project](https://app.svgator.com/) and use extensive programmatic control to create stunning interactive animations easier and faster than ever before!

New to SVGator? Check out this [list of its latest features](https://www.svgator.com/blog/svgator-features-you-might-have-missed/) or get a [crash course on the best practices](https://www.svgator.com/blog/speed-up-your-design-process-with-svgator/) from the tool's design team including the founding members. 

Keep in mind that there’s no third-party software/plugin that you need to start using SVGator to its fullest potential. It is a browser-based SVG animator that exports lightweight files for both web and mobile platforms (.svg, .js, and .dart).


Have any questions? Want to leave a suggestion? Wanna chat about how awesome animating is? Let’s connect on [Facebook](https://www.facebook.com/svgator/), [Instagram](https://www.instagram.com/svgatorapp/) or [Twitter](https://twitter.com/SVGatorApp)!