{"action":"created","comment":{"url":"https://api.github.com/repos/guardian/frontend/pulls/comments/199795234","pull_request_review_id":133982505,"id":199795234,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDE5OTc5NTIzNA==","diff_hunk":"@@ -22,4 +24,28 @@ const range = (min: number, max: number) => {\n     return ret;\n };\n \n-export { format, formatTime, range };\n+const sendToOphan = (id: string, eventName: string) => {\n+    ophan.record({\n+        audio: {\n+            id,\n+            eventType: `audio:content:${eventName}`,\n+        },\n+    });\n+};\n+\n+const checkForTimeEvents = (id: string, percent: number) => {\n+    if (percent === 25) {\n+        sendToOphan(id, '25');\n+    }","path":"static/src/javascripts/projects/common/modules/audio/utils.js","position":26,"original_position":26,"commit_id":"4ae84a917c340581f2947ea33fe0623b5a442ea4","original_commit_id":"4ae84a917c340581f2947ea33fe0623b5a442ea4","user":{"login":"regiskuckaertz","id":629976,"node_id":"MDQ6VXNlcjYyOTk3Ng==","avatar_url":"https://avatars2.githubusercontent.com/u/629976?v=4","gravatar_id":"","url":"https://api.github.com/users/regiskuckaertz","html_url":"https://github.com/regiskuckaertz","followers_url":"https://api.github.com/users/regiskuckaertz/followers","following_url":"https://api.github.com/users/regiskuckaertz/following{/other_user}","gists_url":"https://api.github.com/users/regiskuckaertz/gists{/gist_id}","starred_url":"https://api.github.com/users/regiskuckaertz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/regiskuckaertz/subscriptions","organizations_url":"https://api.github.com/users/regiskuckaertz/orgs","repos_url":"https://api.github.com/users/regiskuckaertz/repos","events_url":"https://api.github.com/users/regiskuckaertz/events{/privacy}","received_events_url":"https://api.github.com/users/regiskuckaertz/received_events","type":"User","site_admin":false},"body":"it's a small thing but you can set each subsequent `if` as the alternative clause to the previous one with `else`","created_at":"2018-07-03T12:53:37Z","updated_at":"2018-07-03T12:53:38Z","html_url":"https://github.com/guardian/frontend/pull/19965#discussion_r199795234","pull_request_url":"https://api.github.com/repos/guardian/frontend/pulls/19965","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/guardian/frontend/pulls/comments/199795234"},"html":{"href":"https://github.com/guardian/frontend/pull/19965#discussion_r199795234"},"pull_request":{"href":"https://api.github.com/repos/guardian/frontend/pulls/19965"}}},"pull_request":{"url":"https://api.github.com/repos/guardian/frontend/pulls/19965","id":198948615,"node_id":"MDExOlB1bGxSZXF1ZXN0MTk4OTQ4NjE1","html_url":"https://github.com/guardian/frontend/pull/19965","diff_url":"https://github.com/guardian/frontend/pull/19965.diff","patch_url":"https://github.com/guardian/frontend/pull/19965.patch","issue_url":"https://api.github.com/repos/guardian/frontend/issues/19965","number":19965,"state":"open","locked":false,"title":"AUDIO A/B Test: Fix visualisation bug, add new data events","user":{"login":"ajwl","id":10324129,"node_id":"MDQ6VXNlcjEwMzI0MTI5","avatar_url":"https://avatars2.githubusercontent.com/u/10324129?v=4","gravatar_id":"","url":"https://api.github.com/users/ajwl","html_url":"https://github.com/ajwl","followers_url":"https://api.github.com/users/ajwl/followers","following_url":"https://api.github.com/users/ajwl/following{/other_user}","gists_url":"https://api.github.com/users/ajwl/gists{/gist_id}","starred_url":"https://api.github.com/users/ajwl/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ajwl/subscriptions","organizations_url":"https://api.github.com/users/ajwl/orgs","repos_url":"https://api.github.com/users/ajwl/repos","events_url":"https://api.github.com/users/ajwl/events{/privacy}","received_events_url":"https://api.github.com/users/ajwl/received_events","type":"User","site_admin":false},"body":"## What does this change?\r\n\r\n1) A bug in the visualisation of the Audio Player stopped the audio data being directed back to the users' speakers - resulting in the audio not being played. These 2 lines fix that:\r\n```\r\n      this.analyser.connect(this.context.destination);\r\n      this.audio.crossOrigin = 'anonymous';\r\n```\r\n\r\n2) This adds 4 new data events for Ophan: 25% played, 50% played, 75% played & complete. \r\n\r\nNB: audio files will still not play until Acast changes the headers on their audio files to allow Cross Origin access. \r\n\r\n## What is the value of this and can you measure success?\r\nParity with data collection on old player \r\n\r\nAudio should actually work \r\n\r\n### Accessibility test checklist\r\n\r\n<!-- for changes that affect how a page appears in the browser -->\r\n\r\n- [ ] [Tested with screen reader](https://accessibility.gutools.co.uk/testing/web/screen-readers/)\r\n- [ ] [Navigable with keyboard](https://accessibility.gutools.co.uk/testing/web/keyboard-navigation/)\r\n- [ ] [Colour contrast passed](https://accessibility.gutools.co.uk/testing/web/colour-contrast/)\r\n\r\n### Tested\r\n\r\n- [x ] Locally\r\n- [ ] On CODE (optional)\r\n\r\n<!-- AB test? https://git.io/v1V0x -->\r\n<!-- Does this PR meet the contributing guidelines? https://git.io/v1VEJ -->\r\n","created_at":"2018-07-03T12:36:01Z","updated_at":"2018-07-03T12:53:38Z","closed_at":null,"merged_at":null,"merge_commit_sha":"5608132f526f851c09de617363cb8e9b9b50fe97","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/guardian/frontend/pulls/19965/commits","review_comments_url":"https://api.github.com/repos/guardian/frontend/pulls/19965/comments","review_comment_url":"https://api.github.com/repos/guardian/frontend/pulls/comments{/number}","comments_url":"https://api.github.com/repos/guardian/frontend/issues/19965/comments","statuses_url":"https://api.github.com/repos/guardian/frontend/statuses/4ae84a917c340581f2947ea33fe0623b5a442ea4","head":{"label":"guardian:audio-test-data-fix","ref":"audio-test-data-fix","sha":"4ae84a917c340581f2947ea33fe0623b5a442ea4","user":{"login":"guardian","id":164318,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE2NDMxOA==","avatar_url":"https://avatars0.githubusercontent.com/u/164318?v=4","gravatar_id":"","url":"https://api.github.com/users/guardian","html_url":"https://github.com/guardian","followers_url":"https://api.github.com/users/guardian/followers","following_url":"https://api.github.com/users/guardian/following{/other_user}","gists_url":"https://api.github.com/users/guardian/gists{/gist_id}","starred_url":"https://api.github.com/users/guardian/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/guardian/subscriptions","organizations_url":"https://api.github.com/users/guardian/orgs","repos_url":"https://api.github.com/users/guardian/repos","events_url":"https://api.github.com/users/guardian/events{/privacy}","received_events_url":"https://api.github.com/users/guardian/received_events","type":"Organization","site_admin":false},"repo":{"id":4370755,"node_id":"MDEwOlJlcG9zaXRvcnk0MzcwNzU1","name":"frontend","full_name":"guardian/frontend","owner":{"login":"guardian","id":164318,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE2NDMxOA==","avatar_url":"https://avatars0.githubusercontent.com/u/164318?v=4","gravatar_id":"","url":"https://api.github.com/users/guardian","html_url":"https://github.com/guardian","followers_url":"https://api.github.com/users/guardian/followers","following_url":"https://api.github.com/users/guardian/following{/other_user}","gists_url":"https://api.github.com/users/guardian/gists{/gist_id}","starred_url":"https://api.github.com/users/guardian/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/guardian/subscriptions","organizations_url":"https://api.github.com/users/guardian/orgs","repos_url":"https://api.github.com/users/guardian/repos","events_url":"https://api.github.com/users/guardian/events{/privacy}","received_events_url":"https://api.github.com/users/guardian/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/guardian/frontend","description":"Source for theguardian.com","fork":false,"url":"https://api.github.com/repos/guardian/frontend","forks_url":"https://api.github.com/repos/guardian/frontend/forks","keys_url":"https://api.github.com/repos/guardian/frontend/keys{/key_id}","collaborators_url":"https://api.github.com/repos/guardian/frontend/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/guardian/frontend/teams","hooks_url":"https://api.github.com/repos/guardian/frontend/hooks","issue_events_url":"https://api.github.com/repos/guardian/frontend/issues/events{/number}","events_url":"https://api.github.com/repos/guardian/frontend/events","assignees_url":"https://api.github.com/repos/guardian/frontend/assignees{/user}","branches_url":"https://api.github.com/repos/guardian/frontend/branches{/branch}","tags_url":"https://api.github.com/repos/guardian/frontend/tags","blobs_url":"https://api.github.com/repos/guardian/frontend/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/guardian/frontend/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/guardian/frontend/git/refs{/sha}","trees_url":"https://api.github.com/repos/guardian/frontend/git/trees{/sha}","statuses_url":"https://api.github.com/repos/guardian/frontend/statuses/{sha}","languages_url":"https://api.github.com/repos/guardian/frontend/languages","stargazers_url":"https://api.github.com/repos/guardian/frontend/stargazers","contributors_url":"https://api.github.com/repos/guardian/frontend/contributors","subscribers_url":"https://api.github.com/repos/guardian/frontend/subscribers","subscription_url":"https://api.github.com/repos/guardian/frontend/subscription","commits_url":"https://api.github.com/repos/guardian/frontend/commits{/sha}","git_commits_url":"https://api.github.com/repos/guardian/frontend/git/commits{/sha}","comments_url":"https://api.github.com/repos/guardian/frontend/comments{/number}","issue_comment_url":"https://api.github.com/repos/guardian/frontend/issues/comments{/number}","contents_url":"https://api.github.com/repos/guardian/frontend/contents/{+path}","compare_url":"https://api.github.com/repos/guardian/frontend/compare/{base}...{head}","merges_url":"https://api.github.com/repos/guardian/frontend/merges","archive_url":"https://api.github.com/repos/guardian/frontend/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/guardian/frontend/downloads","issues_url":"https://api.github.com/repos/guardian/frontend/issues{/number}","pulls_url":"https://api.github.com/repos/guardian/frontend/pulls{/number}","milestones_url":"https://api.github.com/repos/guardian/frontend/milestones{/number}","notifications_url":"https://api.github.com/repos/guardian/frontend/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/guardian/frontend/labels{/name}","releases_url":"https://api.github.com/repos/guardian/frontend/releases{/id}","deployments_url":"https://api.github.com/repos/guardian/frontend/deployments","created_at":"2012-05-18T15:39:15Z","updated_at":"2018-07-03T10:57:18Z","pushed_at":"2018-07-03T12:52:59Z","git_url":"git://github.com/guardian/frontend.git","ssh_url":"git@github.com:guardian/frontend.git","clone_url":"https://github.com/guardian/frontend.git","svn_url":"https://github.com/guardian/frontend","homepage":"https://www.theguardian.com","size":598625,"stargazers_count":4067,"watchers_count":4067,"language":"HTML","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":450,"mirror_url":null,"archived":false,"open_issues_count":56,"license":{"key":"other","name":"Other","spdx_id":null,"url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":450,"open_issues":56,"watchers":4067,"default_branch":"master"}},"base":{"label":"guardian:master","ref":"master","sha":"3e5020769479bf5beec092cf490a3c0984847875","user":{"login":"guardian","id":164318,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE2NDMxOA==","avatar_url":"https://avatars0.githubusercontent.com/u/164318?v=4","gravatar_id":"","url":"https://api.github.com/users/guardian","html_url":"https://github.com/guardian","followers_url":"https://api.github.com/users/guardian/followers","following_url":"https://api.github.com/users/guardian/following{/other_user}","gists_url":"https://api.github.com/users/guardian/gists{/gist_id}","starred_url":"https://api.github.com/users/guardian/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/guardian/subscriptions","organizations_url":"https://api.github.com/users/guardian/orgs","repos_url":"https://api.github.com/users/guardian/repos","events_url":"https://api.github.com/users/guardian/events{/privacy}","received_events_url":"https://api.github.com/users/guardian/received_events","type":"Organization","site_admin":false},"repo":{"id":4370755,"node_id":"MDEwOlJlcG9zaXRvcnk0MzcwNzU1","name":"frontend","full_name":"guardian/frontend","owner":{"login":"guardian","id":164318,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE2NDMxOA==","avatar_url":"https://avatars0.githubusercontent.com/u/164318?v=4","gravatar_id":"","url":"https://api.github.com/users/guardian","html_url":"https://github.com/guardian","followers_url":"https://api.github.com/users/guardian/followers","following_url":"https://api.github.com/users/guardian/following{/other_user}","gists_url":"https://api.github.com/users/guardian/gists{/gist_id}","starred_url":"https://api.github.com/users/guardian/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/guardian/subscriptions","organizations_url":"https://api.github.com/users/guardian/orgs","repos_url":"https://api.github.com/users/guardian/repos","events_url":"https://api.github.com/users/guardian/events{/privacy}","received_events_url":"https://api.github.com/users/guardian/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/guardian/frontend","description":"Source for theguardian.com","fork":false,"url":"https://api.github.com/repos/guardian/frontend","forks_url":"https://api.github.com/repos/guardian/frontend/forks","keys_url":"https://api.github.com/repos/guardian/frontend/keys{/key_id}","collaborators_url":"https://api.github.com/repos/guardian/frontend/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/guardian/frontend/teams","hooks_url":"https://api.github.com/repos/guardian/frontend/hooks","issue_events_url":"https://api.github.com/repos/guardian/frontend/issues/events{/number}","events_url":"https://api.github.com/repos/guardian/frontend/events","assignees_url":"https://api.github.com/repos/guardian/frontend/assignees{/user}","branches_url":"https://api.github.com/repos/guardian/frontend/branches{/branch}","tags_url":"https://api.github.com/repos/guardian/frontend/tags","blobs_url":"https://api.github.com/repos/guardian/frontend/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/guardian/frontend/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/guardian/frontend/git/refs{/sha}","trees_url":"https://api.github.com/repos/guardian/frontend/git/trees{/sha}","statuses_url":"https://api.github.com/repos/guardian/frontend/statuses/{sha}","languages_url":"https://api.github.com/repos/guardian/frontend/languages","stargazers_url":"https://api.github.com/repos/guardian/frontend/stargazers","contributors_url":"https://api.github.com/repos/guardian/frontend/contributors","subscribers_url":"https://api.github.com/repos/guardian/frontend/subscribers","subscription_url":"https://api.github.com/repos/guardian/frontend/subscription","commits_url":"https://api.github.com/repos/guardian/frontend/commits{/sha}","git_commits_url":"https://api.github.com/repos/guardian/frontend/git/commits{/sha}","comments_url":"https://api.github.com/repos/guardian/frontend/comments{/number}","issue_comment_url":"https://api.github.com/repos/guardian/frontend/issues/comments{/number}","contents_url":"https://api.github.com/repos/guardian/frontend/contents/{+path}","compare_url":"https://api.github.com/repos/guardian/frontend/compare/{base}...{head}","merges_url":"https://api.github.com/repos/guardian/frontend/merges","archive_url":"https://api.github.com/repos/guardian/frontend/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/guardian/frontend/downloads","issues_url":"https://api.github.com/repos/guardian/frontend/issues{/number}","pulls_url":"https://api.github.com/repos/guardian/frontend/pulls{/number}","milestones_url":"https://api.github.com/repos/guardian/frontend/milestones{/number}","notifications_url":"https://api.github.com/repos/guardian/frontend/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/guardian/frontend/labels{/name}","releases_url":"https://api.github.com/repos/guardian/frontend/releases{/id}","deployments_url":"https://api.github.com/repos/guardian/frontend/deployments","created_at":"2012-05-18T15:39:15Z","updated_at":"2018-07-03T10:57:18Z","pushed_at":"2018-07-03T12:52:59Z","git_url":"git://github.com/guardian/frontend.git","ssh_url":"git@github.com:guardian/frontend.git","clone_url":"https://github.com/guardian/frontend.git","svn_url":"https://github.com/guardian/frontend","homepage":"https://www.theguardian.com","size":598625,"stargazers_count":4067,"watchers_count":4067,"language":"HTML","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":450,"mirror_url":null,"archived":false,"open_issues_count":56,"license":{"key":"other","name":"Other","spdx_id":null,"url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":450,"open_issues":56,"watchers":4067,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/guardian/frontend/pulls/19965"},"html":{"href":"https://github.com/guardian/frontend/pull/19965"},"issue":{"href":"https://api.github.com/repos/guardian/frontend/issues/19965"},"comments":{"href":"https://api.github.com/repos/guardian/frontend/issues/19965/comments"},"review_comments":{"href":"https://api.github.com/repos/guardian/frontend/pulls/19965/comments"},"review_comment":{"href":"https://api.github.com/repos/guardian/frontend/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/guardian/frontend/pulls/19965/commits"},"statuses":{"href":"https://api.github.com/repos/guardian/frontend/statuses/4ae84a917c340581f2947ea33fe0623b5a442ea4"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"regiskuckaertz"}}