{"action":"created","comment":{"url":"https://api.github.com/repos/jeef3/angular-swfobject/pulls/comments/44829669","id":44829669,"diff_hunk":"@@ -46,23 +46,37 @@ angular.module('swfobject', [])\n           });\n         }\n \n-\n         // http://learnswfobject.com/advanced-topics/executing-javascript-when-the-swf-has-finished-loading/\n         function swfLoadEvent(evt, fn) {\n-            //Set up a timer to periodically check value of PercentLoaded\n-            var loadCheckInterval = $interval(function () {\n-              //Ensure Flash Player's PercentLoaded method is available and returns a value\n-              if (typeof evt.ref.PercentLoaded !== \"undefined\" && evt.ref.PercentLoaded()) {\n-                //Once value == 100 (fully loaded) we can do whatever we want\n-                if (evt.ref.PercentLoaded() === 100) {\n-                  //Clear interval\n-                  $interval.cancel(loadCheckInterval);\n-                  loadCheckInterval = null;\n-                  //Execute function\n-                  fn({evt: evt});\n+            //This interval ensures we don't try to access PercentLoaded too soon\n+            var startCheckInterval = $interval(function () {\n+                //Ensure Flash Player's PercentLoaded method is available\n+                if (typeof evt.ref.PercentLoaded !== 'undefined') {\n+                    $interval.cancel(startCheckInterval);\n+                    startCheckInterval = null;","path":"angular-swfobject.js","position":23,"original_position":23,"commit_id":"52b54ef16e353b7b5fab8559c0ab2e34880652da","original_commit_id":"52b54ef16e353b7b5fab8559c0ab2e34880652da","user":{"login":"jeef3","id":577141,"avatar_url":"https://avatars.githubusercontent.com/u/577141?v=3","gravatar_id":"","url":"https://api.github.com/users/jeef3","html_url":"https://github.com/jeef3","followers_url":"https://api.github.com/users/jeef3/followers","following_url":"https://api.github.com/users/jeef3/following{/other_user}","gists_url":"https://api.github.com/users/jeef3/gists{/gist_id}","starred_url":"https://api.github.com/users/jeef3/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jeef3/subscriptions","organizations_url":"https://api.github.com/users/jeef3/orgs","repos_url":"https://api.github.com/users/jeef3/repos","events_url":"https://api.github.com/users/jeef3/events{/privacy}","received_events_url":"https://api.github.com/users/jeef3/received_events","type":"User","site_admin":false},"body":"We could probably avoid all this interval checking and cancelling by using timeouts instead?","created_at":"2015-11-13T20:22:59Z","updated_at":"2015-11-13T20:22:59Z","html_url":"https://github.com/jeef3/angular-swfobject/pull/8#discussion_r44829669","pull_request_url":"https://api.github.com/repos/jeef3/angular-swfobject/pulls/8","_links":{"self":{"href":"https://api.github.com/repos/jeef3/angular-swfobject/pulls/comments/44829669"},"html":{"href":"https://github.com/jeef3/angular-swfobject/pull/8#discussion_r44829669"},"pull_request":{"href":"https://api.github.com/repos/jeef3/angular-swfobject/pulls/8"}}},"pull_request":{"url":"https://api.github.com/repos/jeef3/angular-swfobject/pulls/8","id":50461849,"html_url":"https://github.com/jeef3/angular-swfobject/pull/8","diff_url":"https://github.com/jeef3/angular-swfobject/pull/8.diff","patch_url":"https://github.com/jeef3/angular-swfobject/pull/8.patch","issue_url":"https://api.github.com/repos/jeef3/angular-swfobject/issues/8","number":8,"state":"open","locked":false,"title":"=BG= make swfLoadEvent() more robust","user":{"login":"bguiz","id":1773785,"avatar_url":"https://avatars.githubusercontent.com/u/1773785?v=3","gravatar_id":"","url":"https://api.github.com/users/bguiz","html_url":"https://github.com/bguiz","followers_url":"https://api.github.com/users/bguiz/followers","following_url":"https://api.github.com/users/bguiz/following{/other_user}","gists_url":"https://api.github.com/users/bguiz/gists{/gist_id}","starred_url":"https://api.github.com/users/bguiz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bguiz/subscriptions","organizations_url":"https://api.github.com/users/bguiz/orgs","repos_url":"https://api.github.com/users/bguiz/repos","events_url":"https://api.github.com/users/bguiz/events{/privacy}","received_events_url":"https://api.github.com/users/bguiz/received_events","type":"User","site_admin":false},"body":"- some race conditions observed in chrome's flash pepper player (too fast or too slow to call `PercentLoaded()`\r\n- use `$interval` instead of `$timeout` to check for initial load to solve this problem","created_at":"2015-11-12T01:41:33Z","updated_at":"2015-11-13T20:22:59Z","closed_at":null,"merged_at":null,"merge_commit_sha":"8ba6d43dbf87bb230bacc9843a4dd2926805e24e","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/jeef3/angular-swfobject/pulls/8/commits","review_comments_url":"https://api.github.com/repos/jeef3/angular-swfobject/pulls/8/comments","review_comment_url":"https://api.github.com/repos/jeef3/angular-swfobject/pulls/comments{/number}","comments_url":"https://api.github.com/repos/jeef3/angular-swfobject/issues/8/comments","statuses_url":"https://api.github.com/repos/jeef3/angular-swfobject/statuses/52b54ef16e353b7b5fab8559c0ab2e34880652da","head":{"label":"bguiz:patch-1","ref":"patch-1","sha":"52b54ef16e353b7b5fab8559c0ab2e34880652da","user":{"login":"bguiz","id":1773785,"avatar_url":"https://avatars.githubusercontent.com/u/1773785?v=3","gravatar_id":"","url":"https://api.github.com/users/bguiz","html_url":"https://github.com/bguiz","followers_url":"https://api.github.com/users/bguiz/followers","following_url":"https://api.github.com/users/bguiz/following{/other_user}","gists_url":"https://api.github.com/users/bguiz/gists{/gist_id}","starred_url":"https://api.github.com/users/bguiz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bguiz/subscriptions","organizations_url":"https://api.github.com/users/bguiz/orgs","repos_url":"https://api.github.com/users/bguiz/repos","events_url":"https://api.github.com/users/bguiz/events{/privacy}","received_events_url":"https://api.github.com/users/bguiz/received_events","type":"User","site_admin":false},"repo":{"id":46021718,"name":"angular-swfobject","full_name":"bguiz/angular-swfobject","owner":{"login":"bguiz","id":1773785,"avatar_url":"https://avatars.githubusercontent.com/u/1773785?v=3","gravatar_id":"","url":"https://api.github.com/users/bguiz","html_url":"https://github.com/bguiz","followers_url":"https://api.github.com/users/bguiz/followers","following_url":"https://api.github.com/users/bguiz/following{/other_user}","gists_url":"https://api.github.com/users/bguiz/gists{/gist_id}","starred_url":"https://api.github.com/users/bguiz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bguiz/subscriptions","organizations_url":"https://api.github.com/users/bguiz/orgs","repos_url":"https://api.github.com/users/bguiz/repos","events_url":"https://api.github.com/users/bguiz/events{/privacy}","received_events_url":"https://api.github.com/users/bguiz/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/bguiz/angular-swfobject","description":"SWFObject directive for AngularJS","fork":true,"url":"https://api.github.com/repos/bguiz/angular-swfobject","forks_url":"https://api.github.com/repos/bguiz/angular-swfobject/forks","keys_url":"https://api.github.com/repos/bguiz/angular-swfobject/keys{/key_id}","collaborators_url":"https://api.github.com/repos/bguiz/angular-swfobject/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/bguiz/angular-swfobject/teams","hooks_url":"https://api.github.com/repos/bguiz/angular-swfobject/hooks","issue_events_url":"https://api.github.com/repos/bguiz/angular-swfobject/issues/events{/number}","events_url":"https://api.github.com/repos/bguiz/angular-swfobject/events","assignees_url":"https://api.github.com/repos/bguiz/angular-swfobject/assignees{/user}","branches_url":"https://api.github.com/repos/bguiz/angular-swfobject/branches{/branch}","tags_url":"https://api.github.com/repos/bguiz/angular-swfobject/tags","blobs_url":"https://api.github.com/repos/bguiz/angular-swfobject/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/bguiz/angular-swfobject/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/bguiz/angular-swfobject/git/refs{/sha}","trees_url":"https://api.github.com/repos/bguiz/angular-swfobject/git/trees{/sha}","statuses_url":"https://api.github.com/repos/bguiz/angular-swfobject/statuses/{sha}","languages_url":"https://api.github.com/repos/bguiz/angular-swfobject/languages","stargazers_url":"https://api.github.com/repos/bguiz/angular-swfobject/stargazers","contributors_url":"https://api.github.com/repos/bguiz/angular-swfobject/contributors","subscribers_url":"https://api.github.com/repos/bguiz/angular-swfobject/subscribers","subscription_url":"https://api.github.com/repos/bguiz/angular-swfobject/subscription","commits_url":"https://api.github.com/repos/bguiz/angular-swfobject/commits{/sha}","git_commits_url":"https://api.github.com/repos/bguiz/angular-swfobject/git/commits{/sha}","comments_url":"https://api.github.com/repos/bguiz/angular-swfobject/comments{/number}","issue_comment_url":"https://api.github.com/repos/bguiz/angular-swfobject/issues/comments{/number}","contents_url":"https://api.github.com/repos/bguiz/angular-swfobject/contents/{+path}","compare_url":"https://api.github.com/repos/bguiz/angular-swfobject/compare/{base}...{head}","merges_url":"https://api.github.com/repos/bguiz/angular-swfobject/merges","archive_url":"https://api.github.com/repos/bguiz/angular-swfobject/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/bguiz/angular-swfobject/downloads","issues_url":"https://api.github.com/repos/bguiz/angular-swfobject/issues{/number}","pulls_url":"https://api.github.com/repos/bguiz/angular-swfobject/pulls{/number}","milestones_url":"https://api.github.com/repos/bguiz/angular-swfobject/milestones{/number}","notifications_url":"https://api.github.com/repos/bguiz/angular-swfobject/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/bguiz/angular-swfobject/labels{/name}","releases_url":"https://api.github.com/repos/bguiz/angular-swfobject/releases{/id}","created_at":"2015-11-12T01:38:07Z","updated_at":"2015-11-09T15:48:31Z","pushed_at":"2015-11-12T04:32:45Z","git_url":"git://github.com/bguiz/angular-swfobject.git","ssh_url":"git@github.com:bguiz/angular-swfobject.git","clone_url":"https://github.com/bguiz/angular-swfobject.git","svn_url":"https://github.com/bguiz/angular-swfobject","homepage":null,"size":221,"stargazers_count":0,"watchers_count":0,"language":null,"has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"jeef3:master","ref":"master","sha":"e2fe8b6e008cf43ace76372aabaa5faf8ce3d571","user":{"login":"jeef3","id":577141,"avatar_url":"https://avatars.githubusercontent.com/u/577141?v=3","gravatar_id":"","url":"https://api.github.com/users/jeef3","html_url":"https://github.com/jeef3","followers_url":"https://api.github.com/users/jeef3/followers","following_url":"https://api.github.com/users/jeef3/following{/other_user}","gists_url":"https://api.github.com/users/jeef3/gists{/gist_id}","starred_url":"https://api.github.com/users/jeef3/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jeef3/subscriptions","organizations_url":"https://api.github.com/users/jeef3/orgs","repos_url":"https://api.github.com/users/jeef3/repos","events_url":"https://api.github.com/users/jeef3/events{/privacy}","received_events_url":"https://api.github.com/users/jeef3/received_events","type":"User","site_admin":false},"repo":{"id":24365356,"name":"angular-swfobject","full_name":"jeef3/angular-swfobject","owner":{"login":"jeef3","id":577141,"avatar_url":"https://avatars.githubusercontent.com/u/577141?v=3","gravatar_id":"","url":"https://api.github.com/users/jeef3","html_url":"https://github.com/jeef3","followers_url":"https://api.github.com/users/jeef3/followers","following_url":"https://api.github.com/users/jeef3/following{/other_user}","gists_url":"https://api.github.com/users/jeef3/gists{/gist_id}","starred_url":"https://api.github.com/users/jeef3/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jeef3/subscriptions","organizations_url":"https://api.github.com/users/jeef3/orgs","repos_url":"https://api.github.com/users/jeef3/repos","events_url":"https://api.github.com/users/jeef3/events{/privacy}","received_events_url":"https://api.github.com/users/jeef3/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/jeef3/angular-swfobject","description":"SWFObject directive for AngularJS","fork":false,"url":"https://api.github.com/repos/jeef3/angular-swfobject","forks_url":"https://api.github.com/repos/jeef3/angular-swfobject/forks","keys_url":"https://api.github.com/repos/jeef3/angular-swfobject/keys{/key_id}","collaborators_url":"https://api.github.com/repos/jeef3/angular-swfobject/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/jeef3/angular-swfobject/teams","hooks_url":"https://api.github.com/repos/jeef3/angular-swfobject/hooks","issue_events_url":"https://api.github.com/repos/jeef3/angular-swfobject/issues/events{/number}","events_url":"https://api.github.com/repos/jeef3/angular-swfobject/events","assignees_url":"https://api.github.com/repos/jeef3/angular-swfobject/assignees{/user}","branches_url":"https://api.github.com/repos/jeef3/angular-swfobject/branches{/branch}","tags_url":"https://api.github.com/repos/jeef3/angular-swfobject/tags","blobs_url":"https://api.github.com/repos/jeef3/angular-swfobject/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/jeef3/angular-swfobject/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/jeef3/angular-swfobject/git/refs{/sha}","trees_url":"https://api.github.com/repos/jeef3/angular-swfobject/git/trees{/sha}","statuses_url":"https://api.github.com/repos/jeef3/angular-swfobject/statuses/{sha}","languages_url":"https://api.github.com/repos/jeef3/angular-swfobject/languages","stargazers_url":"https://api.github.com/repos/jeef3/angular-swfobject/stargazers","contributors_url":"https://api.github.com/repos/jeef3/angular-swfobject/contributors","subscribers_url":"https://api.github.com/repos/jeef3/angular-swfobject/subscribers","subscription_url":"https://api.github.com/repos/jeef3/angular-swfobject/subscription","commits_url":"https://api.github.com/repos/jeef3/angular-swfobject/commits{/sha}","git_commits_url":"https://api.github.com/repos/jeef3/angular-swfobject/git/commits{/sha}","comments_url":"https://api.github.com/repos/jeef3/angular-swfobject/comments{/number}","issue_comment_url":"https://api.github.com/repos/jeef3/angular-swfobject/issues/comments{/number}","contents_url":"https://api.github.com/repos/jeef3/angular-swfobject/contents/{+path}","compare_url":"https://api.github.com/repos/jeef3/angular-swfobject/compare/{base}...{head}","merges_url":"https://api.github.com/repos/jeef3/angular-swfobject/merges","archive_url":"https://api.github.com/repos/jeef3/angular-swfobject/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/jeef3/angular-swfobject/downloads","issues_url":"https://api.github.com/repos/jeef3/angular-swfobject/issues{/number}","pulls_url":"https://api.github.com/repos/jeef3/angular-swfobject/pulls{/number}","milestones_url":"https://api.github.com/repos/jeef3/angular-swfobject/milestones{/number}","notifications_url":"https://api.github.com/repos/jeef3/angular-swfobject/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/jeef3/angular-swfobject/labels{/name}","releases_url":"https://api.github.com/repos/jeef3/angular-swfobject/releases{/id}","created_at":"2014-09-23T09:36:05Z","updated_at":"2015-11-09T15:48:31Z","pushed_at":"2015-11-12T04:32:58Z","git_url":"git://github.com/jeef3/angular-swfobject.git","ssh_url":"git@github.com:jeef3/angular-swfobject.git","clone_url":"https://github.com/jeef3/angular-swfobject.git","svn_url":"https://github.com/jeef3/angular-swfobject","homepage":null,"size":221,"stargazers_count":8,"watchers_count":8,"language":null,"has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":7,"mirror_url":null,"open_issues_count":3,"forks":7,"open_issues":3,"watchers":8,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/jeef3/angular-swfobject/pulls/8"},"html":{"href":"https://github.com/jeef3/angular-swfobject/pull/8"},"issue":{"href":"https://api.github.com/repos/jeef3/angular-swfobject/issues/8"},"comments":{"href":"https://api.github.com/repos/jeef3/angular-swfobject/issues/8/comments"},"review_comments":{"href":"https://api.github.com/repos/jeef3/angular-swfobject/pulls/8/comments"},"review_comment":{"href":"https://api.github.com/repos/jeef3/angular-swfobject/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/jeef3/angular-swfobject/pulls/8/commits"},"statuses":{"href":"https://api.github.com/repos/jeef3/angular-swfobject/statuses/52b54ef16e353b7b5fab8559c0ab2e34880652da"}}}}