Animatron/player — pull request #52 by shamansir (2012-09-27 10:26:08+00:00)
Title: Player.forSnapshot method

Player.forSnapshot method

It allows us (and user) easily load player from embed URL.

In Animatron, URL is formed like:

http://:/embed/[?param1=value[¶m2=value]]

where parameters are optional. Now you may quickly set the options for embedded player through
these parameters.

Currently supported parameters are:

* `t=` (`t=650`) — time to start playing the animation from, in tens of milliseconds, so `650` means `6.5s`
* `p=` (`p=650`) — time to pause the animation at start, in tens of milliseconds, so `650` means `6.5s`
* `w=` (`w=700`) — specify width for a player, it will override the scene settings
* `h=` (`h=250`) — specify height for a player, it will override the scene settings
* `r=` (`r=true`, `repeat=1`) — repeat mode for a player, so it will repeat the scene infinitely when this flag is turned on
* `m=` (`m=1`) — `0` is preview mode, `4` is dynamic mode, `3` is (default) video mode
* `z=` (`z=2.2`) — specify zoom for the player
* `bg=` (`bg=6600aa`) — specify the background color for player
* `debug=` (`debug=true`, `debug=1`) — launch a player in debug mode

However, in `forSnapshot` method you need to pass parameters in JSON format like:

anm.Player.forSnapshot('my-canvas',
'http://acme.com:8080/embed/s0m3l0n91d',
{ w: 700, h: 300, t: 500 },
new AnimatronImporter());