{"action":"created","comment":{"url":"https://api.github.com/repos/ampproject/amphtml/pulls/comments/188426130","pull_request_review_id":120402622,"id":188426130,"diff_hunk":"@@ -23,28 +25,50 @@ import {parseJson} from '../src/json';\n  * @param {function(!Object)} cb\n  */\n \n+let animationHandler;\n+\n function getBodymovinAnimationSdk(global, cb) {\n   loadScript(global, 'https://cdnjs.cloudflare.com/ajax/libs/bodymovin/4.13.0/bodymovin_light.min.js', function() {\n     cb(global.bodymovin);\n   });\n }\n \n+function parseMessage(event) {\n+  const eventMessage = parseJson(getData(event));\n+  const action = eventMessage['action'];\n+  if (action == 'play') {\n+    animationHandler.play();\n+  } else if (action == 'pause') {\n+    animationHandler.pause();\n+  } else if (action == 'stop') {\n+    animationHandler.stop();\n+  } else if (action == 'seekTo') {\n+    animationHandler.goToAndStop(eventMessage['value'],","path":"3p/bodymovinanimation.js","position":31,"original_position":31,"commit_id":"e570df058e647d2832faf75b4294612129e7c4f5","original_commit_id":"efd7623942ee5210aafac136bfa89f7e232d8097","user":{"login":"jessepinho","id":1121544,"avatar_url":"https://avatars0.githubusercontent.com/u/1121544?v=4","gravatar_id":"","url":"https://api.github.com/users/jessepinho","html_url":"https://github.com/jessepinho","followers_url":"https://api.github.com/users/jessepinho/followers","following_url":"https://api.github.com/users/jessepinho/following{/other_user}","gists_url":"https://api.github.com/users/jessepinho/gists{/gist_id}","starred_url":"https://api.github.com/users/jessepinho/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jessepinho/subscriptions","organizations_url":"https://api.github.com/users/jessepinho/orgs","repos_url":"https://api.github.com/users/jessepinho/repos","events_url":"https://api.github.com/users/jessepinho/events{/privacy}","received_events_url":"https://api.github.com/users/jessepinho/received_events","type":"User","site_admin":false},"body":"@nainar When `isFrame` is `true`, the first parameter is the actual frame *number*. So, to get it to be a percentage, you'd have to divide that number by the total number of frames.\r\n\r\nI can make a pull request to fix this if you're open to it!","created_at":"2018-05-15T20:30:48Z","updated_at":"2018-05-15T20:30:48Z","html_url":"https://github.com/ampproject/amphtml/pull/14040#discussion_r188426130","pull_request_url":"https://api.github.com/repos/ampproject/amphtml/pulls/14040","author_association":"NONE","_links":{"self":{"href":"https://api.github.com/repos/ampproject/amphtml/pulls/comments/188426130"},"html":{"href":"https://github.com/ampproject/amphtml/pull/14040#discussion_r188426130"},"pull_request":{"href":"https://api.github.com/repos/ampproject/amphtml/pulls/14040"}},"in_reply_to_id":175625162},"pull_request":{"url":"https://api.github.com/repos/ampproject/amphtml/pulls/14040","id":175408692,"html_url":"https://github.com/ampproject/amphtml/pull/14040","diff_url":"https://github.com/ampproject/amphtml/pull/14040.diff","patch_url":"https://github.com/ampproject/amphtml/pull/14040.patch","issue_url":"https://api.github.com/repos/ampproject/amphtml/issues/14040","number":14040,"state":"closed","locked":false,"title":"<amp-bodymovin-actions> Add actions play/pause/stop/seekTo and noautoplay attribute","user":{"login":"nainar","id":7919520,"avatar_url":"https://avatars2.githubusercontent.com/u/7919520?v=4","gravatar_id":"","url":"https://api.github.com/users/nainar","html_url":"https://github.com/nainar","followers_url":"https://api.github.com/users/nainar/followers","following_url":"https://api.github.com/users/nainar/following{/other_user}","gists_url":"https://api.github.com/users/nainar/gists{/gist_id}","starred_url":"https://api.github.com/users/nainar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nainar/subscriptions","organizations_url":"https://api.github.com/users/nainar/orgs","repos_url":"https://api.github.com/users/nainar/repos","events_url":"https://api.github.com/users/nainar/events{/privacy}","received_events_url":"https://api.github.com/users/nainar/received_events","type":"User","site_admin":false},"body":"Future work: (low priority can potentially file as GFIs)\r\n* Add animationData attribute (most useful)\r\n* Add speed attribute\r\n* Add direction attribute\r\n","created_at":"2018-03-15T23:54:01Z","updated_at":"2018-05-15T20:30:48Z","closed_at":"2018-03-20T16:23:11Z","merged_at":"2018-03-20T16:23:11Z","merge_commit_sha":"b28c57eecb3b4c6558d7a7b2ea4d1106e95c1ddc","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[{"id":596633554,"url":"https://api.github.com/repos/ampproject/amphtml/labels/cla:%20yes","name":"cla: yes","color":"ededed","default":false}],"milestone":null,"commits_url":"https://api.github.com/repos/ampproject/amphtml/pulls/14040/commits","review_comments_url":"https://api.github.com/repos/ampproject/amphtml/pulls/14040/comments","review_comment_url":"https://api.github.com/repos/ampproject/amphtml/pulls/comments{/number}","comments_url":"https://api.github.com/repos/ampproject/amphtml/issues/14040/comments","statuses_url":"https://api.github.com/repos/ampproject/amphtml/statuses/e570df058e647d2832faf75b4294612129e7c4f5","head":{"label":"nainar:amp_bodymovin_actions","ref":"amp_bodymovin_actions","sha":"e570df058e647d2832faf75b4294612129e7c4f5","user":{"login":"nainar","id":7919520,"avatar_url":"https://avatars2.githubusercontent.com/u/7919520?v=4","gravatar_id":"","url":"https://api.github.com/users/nainar","html_url":"https://github.com/nainar","followers_url":"https://api.github.com/users/nainar/followers","following_url":"https://api.github.com/users/nainar/following{/other_user}","gists_url":"https://api.github.com/users/nainar/gists{/gist_id}","starred_url":"https://api.github.com/users/nainar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nainar/subscriptions","organizations_url":"https://api.github.com/users/nainar/orgs","repos_url":"https://api.github.com/users/nainar/repos","events_url":"https://api.github.com/users/nainar/events{/privacy}","received_events_url":"https://api.github.com/users/nainar/received_events","type":"User","site_admin":false},"repo":{"id":117491033,"name":"amphtml","full_name":"nainar/amphtml","owner":{"login":"nainar","id":7919520,"avatar_url":"https://avatars2.githubusercontent.com/u/7919520?v=4","gravatar_id":"","url":"https://api.github.com/users/nainar","html_url":"https://github.com/nainar","followers_url":"https://api.github.com/users/nainar/followers","following_url":"https://api.github.com/users/nainar/following{/other_user}","gists_url":"https://api.github.com/users/nainar/gists{/gist_id}","starred_url":"https://api.github.com/users/nainar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nainar/subscriptions","organizations_url":"https://api.github.com/users/nainar/orgs","repos_url":"https://api.github.com/users/nainar/repos","events_url":"https://api.github.com/users/nainar/events{/privacy}","received_events_url":"https://api.github.com/users/nainar/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/nainar/amphtml","description":"AMP HTML source code, samples, and documentation.  See below for more info.","fork":true,"url":"https://api.github.com/repos/nainar/amphtml","forks_url":"https://api.github.com/repos/nainar/amphtml/forks","keys_url":"https://api.github.com/repos/nainar/amphtml/keys{/key_id}","collaborators_url":"https://api.github.com/repos/nainar/amphtml/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/nainar/amphtml/teams","hooks_url":"https://api.github.com/repos/nainar/amphtml/hooks","issue_events_url":"https://api.github.com/repos/nainar/amphtml/issues/events{/number}","events_url":"https://api.github.com/repos/nainar/amphtml/events","assignees_url":"https://api.github.com/repos/nainar/amphtml/assignees{/user}","branches_url":"https://api.github.com/repos/nainar/amphtml/branches{/branch}","tags_url":"https://api.github.com/repos/nainar/amphtml/tags","blobs_url":"https://api.github.com/repos/nainar/amphtml/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/nainar/amphtml/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/nainar/amphtml/git/refs{/sha}","trees_url":"https://api.github.com/repos/nainar/amphtml/git/trees{/sha}","statuses_url":"https://api.github.com/repos/nainar/amphtml/statuses/{sha}","languages_url":"https://api.github.com/repos/nainar/amphtml/languages","stargazers_url":"https://api.github.com/repos/nainar/amphtml/stargazers","contributors_url":"https://api.github.com/repos/nainar/amphtml/contributors","subscribers_url":"https://api.github.com/repos/nainar/amphtml/subscribers","subscription_url":"https://api.github.com/repos/nainar/amphtml/subscription","commits_url":"https://api.github.com/repos/nainar/amphtml/commits{/sha}","git_commits_url":"https://api.github.com/repos/nainar/amphtml/git/commits{/sha}","comments_url":"https://api.github.com/repos/nainar/amphtml/comments{/number}","issue_comment_url":"https://api.github.com/repos/nainar/amphtml/issues/comments{/number}","contents_url":"https://api.github.com/repos/nainar/amphtml/contents/{+path}","compare_url":"https://api.github.com/repos/nainar/amphtml/compare/{base}...{head}","merges_url":"https://api.github.com/repos/nainar/amphtml/merges","archive_url":"https://api.github.com/repos/nainar/amphtml/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/nainar/amphtml/downloads","issues_url":"https://api.github.com/repos/nainar/amphtml/issues{/number}","pulls_url":"https://api.github.com/repos/nainar/amphtml/pulls{/number}","milestones_url":"https://api.github.com/repos/nainar/amphtml/milestones{/number}","notifications_url":"https://api.github.com/repos/nainar/amphtml/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/nainar/amphtml/labels{/name}","releases_url":"https://api.github.com/repos/nainar/amphtml/releases{/id}","deployments_url":"https://api.github.com/repos/nainar/amphtml/deployments","created_at":"2018-01-15T03:09:24Z","updated_at":"2018-01-15T03:09:36Z","pushed_at":"2018-05-15T17:57:39Z","git_url":"git://github.com/nainar/amphtml.git","ssh_url":"git@github.com:nainar/amphtml.git","clone_url":"https://github.com/nainar/amphtml.git","svn_url":"https://github.com/nainar/amphtml","homepage":"https://www.ampproject.org","size":454109,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_projects":true,"has_downloads":false,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0"},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"ampproject:master","ref":"master","sha":"35728891d47dc92462daec8520139ecf377a0f3e","user":{"login":"ampproject","id":14114390,"avatar_url":"https://avatars3.githubusercontent.com/u/14114390?v=4","gravatar_id":"","url":"https://api.github.com/users/ampproject","html_url":"https://github.com/ampproject","followers_url":"https://api.github.com/users/ampproject/followers","following_url":"https://api.github.com/users/ampproject/following{/other_user}","gists_url":"https://api.github.com/users/ampproject/gists{/gist_id}","starred_url":"https://api.github.com/users/ampproject/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ampproject/subscriptions","organizations_url":"https://api.github.com/users/ampproject/orgs","repos_url":"https://api.github.com/users/ampproject/repos","events_url":"https://api.github.com/users/ampproject/events{/privacy}","received_events_url":"https://api.github.com/users/ampproject/received_events","type":"Organization","site_admin":false},"repo":{"id":41766002,"name":"amphtml","full_name":"ampproject/amphtml","owner":{"login":"ampproject","id":14114390,"avatar_url":"https://avatars3.githubusercontent.com/u/14114390?v=4","gravatar_id":"","url":"https://api.github.com/users/ampproject","html_url":"https://github.com/ampproject","followers_url":"https://api.github.com/users/ampproject/followers","following_url":"https://api.github.com/users/ampproject/following{/other_user}","gists_url":"https://api.github.com/users/ampproject/gists{/gist_id}","starred_url":"https://api.github.com/users/ampproject/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ampproject/subscriptions","organizations_url":"https://api.github.com/users/ampproject/orgs","repos_url":"https://api.github.com/users/ampproject/repos","events_url":"https://api.github.com/users/ampproject/events{/privacy}","received_events_url":"https://api.github.com/users/ampproject/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/ampproject/amphtml","description":"AMP HTML source code, samples, and documentation.  See below for more info.","fork":false,"url":"https://api.github.com/repos/ampproject/amphtml","forks_url":"https://api.github.com/repos/ampproject/amphtml/forks","keys_url":"https://api.github.com/repos/ampproject/amphtml/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ampproject/amphtml/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ampproject/amphtml/teams","hooks_url":"https://api.github.com/repos/ampproject/amphtml/hooks","issue_events_url":"https://api.github.com/repos/ampproject/amphtml/issues/events{/number}","events_url":"https://api.github.com/repos/ampproject/amphtml/events","assignees_url":"https://api.github.com/repos/ampproject/amphtml/assignees{/user}","branches_url":"https://api.github.com/repos/ampproject/amphtml/branches{/branch}","tags_url":"https://api.github.com/repos/ampproject/amphtml/tags","blobs_url":"https://api.github.com/repos/ampproject/amphtml/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ampproject/amphtml/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ampproject/amphtml/git/refs{/sha}","trees_url":"https://api.github.com/repos/ampproject/amphtml/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ampproject/amphtml/statuses/{sha}","languages_url":"https://api.github.com/repos/ampproject/amphtml/languages","stargazers_url":"https://api.github.com/repos/ampproject/amphtml/stargazers","contributors_url":"https://api.github.com/repos/ampproject/amphtml/contributors","subscribers_url":"https://api.github.com/repos/ampproject/amphtml/subscribers","subscription_url":"https://api.github.com/repos/ampproject/amphtml/subscription","commits_url":"https://api.github.com/repos/ampproject/amphtml/commits{/sha}","git_commits_url":"https://api.github.com/repos/ampproject/amphtml/git/commits{/sha}","comments_url":"https://api.github.com/repos/ampproject/amphtml/comments{/number}","issue_comment_url":"https://api.github.com/repos/ampproject/amphtml/issues/comments{/number}","contents_url":"https://api.github.com/repos/ampproject/amphtml/contents/{+path}","compare_url":"https://api.github.com/repos/ampproject/amphtml/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ampproject/amphtml/merges","archive_url":"https://api.github.com/repos/ampproject/amphtml/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ampproject/amphtml/downloads","issues_url":"https://api.github.com/repos/ampproject/amphtml/issues{/number}","pulls_url":"https://api.github.com/repos/ampproject/amphtml/pulls{/number}","milestones_url":"https://api.github.com/repos/ampproject/amphtml/milestones{/number}","notifications_url":"https://api.github.com/repos/ampproject/amphtml/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ampproject/amphtml/labels{/name}","releases_url":"https://api.github.com/repos/ampproject/amphtml/releases{/id}","deployments_url":"https://api.github.com/repos/ampproject/amphtml/deployments","created_at":"2015-09-01T22:10:53Z","updated_at":"2018-05-15T20:14:32Z","pushed_at":"2018-05-15T20:28:21Z","git_url":"git://github.com/ampproject/amphtml.git","ssh_url":"git@github.com:ampproject/amphtml.git","clone_url":"https://github.com/ampproject/amphtml.git","svn_url":"https://github.com/ampproject/amphtml","homepage":"https://www.ampproject.org","size":444018,"stargazers_count":11569,"watchers_count":11569,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":false,"has_wiki":false,"has_pages":false,"forks_count":2386,"mirror_url":null,"archived":false,"open_issues_count":1349,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0"},"forks":2386,"open_issues":1349,"watchers":11569,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/ampproject/amphtml/pulls/14040"},"html":{"href":"https://github.com/ampproject/amphtml/pull/14040"},"issue":{"href":"https://api.github.com/repos/ampproject/amphtml/issues/14040"},"comments":{"href":"https://api.github.com/repos/ampproject/amphtml/issues/14040/comments"},"review_comments":{"href":"https://api.github.com/repos/ampproject/amphtml/pulls/14040/comments"},"review_comment":{"href":"https://api.github.com/repos/ampproject/amphtml/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/ampproject/amphtml/pulls/14040/commits"},"statuses":{"href":"https://api.github.com/repos/ampproject/amphtml/statuses/e570df058e647d2832faf75b4294612129e7c4f5"}},"author_association":"COLLABORATOR"}}
{"actor":{"display_login":"jessepinho"}}