{"action":"created","comment":{"url":"https://api.github.com/repos/Wizcorp/AudioManager/pulls/comments/39009926","id":39009926,"diff_hunk":"@@ -72,10 +70,24 @@ Sound.prototype._load = function (filePath) {\n \t\tself._audio.load();\n \t}\n \n-\tif (window.wizAssets) {\n-\t\twindow.wizAssets.downloadFile(filePath, this._src, loadAudio, loadFail);\n+\tvar getFileUri = this.audioManager.settings.getFileUri;\n+\tvar audioPath  = this.audioManager.settings.audioPath;\n+\n+\tif (getFileUri.length > 2) {\n+\t\t// asynchronous\n+\t\tgetFileUri(audioPath, this.id, function onUri(error, uri) {\n+\t\t\tif (error) return loadFail(error);\n+\t\t\tloadAudio(uri);\n+\t\t});\n \t} else {\n-\t\tloadAudio(filePath);\n+\t\t// synchronous\n+\t\ttry {\n+\t\t\tvar uri = getFileUri(audioPath, this.id);\n+\t\t\t// TODO: check uri existence","path":"Sound.js","position":52,"original_position":52,"commit_id":"899eb8264c73b8f983b8e597af351cf898003d02","original_commit_id":"899eb8264c73b8f983b8e597af351cf898003d02","user":{"login":"cstoquer","id":2462139,"avatar_url":"https://avatars.githubusercontent.com/u/2462139?v=3","gravatar_id":"","url":"https://api.github.com/users/cstoquer","html_url":"https://github.com/cstoquer","followers_url":"https://api.github.com/users/cstoquer/followers","following_url":"https://api.github.com/users/cstoquer/following{/other_user}","gists_url":"https://api.github.com/users/cstoquer/gists{/gist_id}","starred_url":"https://api.github.com/users/cstoquer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cstoquer/subscriptions","organizations_url":"https://api.github.com/users/cstoquer/orgs","repos_url":"https://api.github.com/users/cstoquer/repos","events_url":"https://api.github.com/users/cstoquer/events{/privacy}","received_events_url":"https://api.github.com/users/cstoquer/received_events","type":"User","site_admin":false},"body":"My intention was only to check that result `uri` is not empty.\r\nI'll just add the code, no need to leave this TODO.","created_at":"2015-09-09T06:08:08Z","updated_at":"2015-09-09T06:08:08Z","html_url":"https://github.com/Wizcorp/AudioManager/pull/10#discussion_r39009926","pull_request_url":"https://api.github.com/repos/Wizcorp/AudioManager/pulls/10","_links":{"self":{"href":"https://api.github.com/repos/Wizcorp/AudioManager/pulls/comments/39009926"},"html":{"href":"https://github.com/Wizcorp/AudioManager/pull/10#discussion_r39009926"},"pull_request":{"href":"https://api.github.com/repos/Wizcorp/AudioManager/pulls/10"}}},"pull_request":{"url":"https://api.github.com/repos/Wizcorp/AudioManager/pulls/10","id":44509508,"html_url":"https://github.com/Wizcorp/AudioManager/pull/10","diff_url":"https://github.com/Wizcorp/AudioManager/pull/10.diff","patch_url":"https://github.com/Wizcorp/AudioManager/pull/10.patch","issue_url":"https://api.github.com/repos/Wizcorp/AudioManager/issues/10","number":10,"state":"open","locked":false,"title":"Remove wizAssets dependency","user":{"login":"cstoquer","id":2462139,"avatar_url":"https://avatars.githubusercontent.com/u/2462139?v=3","gravatar_id":"","url":"https://api.github.com/users/cstoquer","html_url":"https://github.com/cstoquer","followers_url":"https://api.github.com/users/cstoquer/followers","following_url":"https://api.github.com/users/cstoquer/following{/other_user}","gists_url":"https://api.github.com/users/cstoquer/gists{/gist_id}","starred_url":"https://api.github.com/users/cstoquer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cstoquer/subscriptions","organizations_url":"https://api.github.com/users/cstoquer/orgs","repos_url":"https://api.github.com/users/cstoquer/repos","events_url":"https://api.github.com/users/cstoquer/events{/privacy}","received_events_url":"https://api.github.com/users/cstoquer/received_events","type":"User","site_admin":false},"body":"Removed `wizAssets` dependency from `AudioManager`.\r\nInstead, a custom loader function can be specified in `settings.getFileUri`\r\n\r\nAdd the following code to use `wizAssets` as loader:\r\n```javascript\r\nif (window.wizAssets) {\r\n\taudioManager.settings.getFileUri = function wizAssetsGetUri(audioPath, id, cb) {\r\n\t\twindow.wizAssets.downloadFile(audioPath + id + '.mp3', 'audio/' + id + '.mp3', \r\n\t\t\tfunction onSuccess(uri) {\r\n\t\t\t\tcb(null, uri)\r\n\t\t\t}, \r\n\t\t\tcb // onFail callback\r\n\t\t);\r\n\t}\r\n}\r\n```","created_at":"2015-09-09T04:26:07Z","updated_at":"2015-09-09T06:08:08Z","closed_at":null,"merged_at":null,"merge_commit_sha":"54f7982c415164625a7cbdcbab88e16782f45635","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/Wizcorp/AudioManager/pulls/10/commits","review_comments_url":"https://api.github.com/repos/Wizcorp/AudioManager/pulls/10/comments","review_comment_url":"https://api.github.com/repos/Wizcorp/AudioManager/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Wizcorp/AudioManager/issues/10/comments","statuses_url":"https://api.github.com/repos/Wizcorp/AudioManager/statuses/899eb8264c73b8f983b8e597af351cf898003d02","head":{"label":"cstoquer:getUri","ref":"getUri","sha":"899eb8264c73b8f983b8e597af351cf898003d02","user":{"login":"cstoquer","id":2462139,"avatar_url":"https://avatars.githubusercontent.com/u/2462139?v=3","gravatar_id":"","url":"https://api.github.com/users/cstoquer","html_url":"https://github.com/cstoquer","followers_url":"https://api.github.com/users/cstoquer/followers","following_url":"https://api.github.com/users/cstoquer/following{/other_user}","gists_url":"https://api.github.com/users/cstoquer/gists{/gist_id}","starred_url":"https://api.github.com/users/cstoquer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cstoquer/subscriptions","organizations_url":"https://api.github.com/users/cstoquer/orgs","repos_url":"https://api.github.com/users/cstoquer/repos","events_url":"https://api.github.com/users/cstoquer/events{/privacy}","received_events_url":"https://api.github.com/users/cstoquer/received_events","type":"User","site_admin":false},"repo":{"id":41461497,"name":"AudioManager","full_name":"cstoquer/AudioManager","owner":{"login":"cstoquer","id":2462139,"avatar_url":"https://avatars.githubusercontent.com/u/2462139?v=3","gravatar_id":"","url":"https://api.github.com/users/cstoquer","html_url":"https://github.com/cstoquer","followers_url":"https://api.github.com/users/cstoquer/followers","following_url":"https://api.github.com/users/cstoquer/following{/other_user}","gists_url":"https://api.github.com/users/cstoquer/gists{/gist_id}","starred_url":"https://api.github.com/users/cstoquer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cstoquer/subscriptions","organizations_url":"https://api.github.com/users/cstoquer/orgs","repos_url":"https://api.github.com/users/cstoquer/repos","events_url":"https://api.github.com/users/cstoquer/events{/privacy}","received_events_url":"https://api.github.com/users/cstoquer/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/cstoquer/AudioManager","description":"play sounds using Web Audio, fallback on HTML5 Audio","fork":true,"url":"https://api.github.com/repos/cstoquer/AudioManager","forks_url":"https://api.github.com/repos/cstoquer/AudioManager/forks","keys_url":"https://api.github.com/repos/cstoquer/AudioManager/keys{/key_id}","collaborators_url":"https://api.github.com/repos/cstoquer/AudioManager/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/cstoquer/AudioManager/teams","hooks_url":"https://api.github.com/repos/cstoquer/AudioManager/hooks","issue_events_url":"https://api.github.com/repos/cstoquer/AudioManager/issues/events{/number}","events_url":"https://api.github.com/repos/cstoquer/AudioManager/events","assignees_url":"https://api.github.com/repos/cstoquer/AudioManager/assignees{/user}","branches_url":"https://api.github.com/repos/cstoquer/AudioManager/branches{/branch}","tags_url":"https://api.github.com/repos/cstoquer/AudioManager/tags","blobs_url":"https://api.github.com/repos/cstoquer/AudioManager/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/cstoquer/AudioManager/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/cstoquer/AudioManager/git/refs{/sha}","trees_url":"https://api.github.com/repos/cstoquer/AudioManager/git/trees{/sha}","statuses_url":"https://api.github.com/repos/cstoquer/AudioManager/statuses/{sha}","languages_url":"https://api.github.com/repos/cstoquer/AudioManager/languages","stargazers_url":"https://api.github.com/repos/cstoquer/AudioManager/stargazers","contributors_url":"https://api.github.com/repos/cstoquer/AudioManager/contributors","subscribers_url":"https://api.github.com/repos/cstoquer/AudioManager/subscribers","subscription_url":"https://api.github.com/repos/cstoquer/AudioManager/subscription","commits_url":"https://api.github.com/repos/cstoquer/AudioManager/commits{/sha}","git_commits_url":"https://api.github.com/repos/cstoquer/AudioManager/git/commits{/sha}","comments_url":"https://api.github.com/repos/cstoquer/AudioManager/comments{/number}","issue_comment_url":"https://api.github.com/repos/cstoquer/AudioManager/issues/comments{/number}","contents_url":"https://api.github.com/repos/cstoquer/AudioManager/contents/{+path}","compare_url":"https://api.github.com/repos/cstoquer/AudioManager/compare/{base}...{head}","merges_url":"https://api.github.com/repos/cstoquer/AudioManager/merges","archive_url":"https://api.github.com/repos/cstoquer/AudioManager/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/cstoquer/AudioManager/downloads","issues_url":"https://api.github.com/repos/cstoquer/AudioManager/issues{/number}","pulls_url":"https://api.github.com/repos/cstoquer/AudioManager/pulls{/number}","milestones_url":"https://api.github.com/repos/cstoquer/AudioManager/milestones{/number}","notifications_url":"https://api.github.com/repos/cstoquer/AudioManager/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/cstoquer/AudioManager/labels{/name}","releases_url":"https://api.github.com/repos/cstoquer/AudioManager/releases{/id}","created_at":"2015-08-27T02:34:06Z","updated_at":"2015-08-27T02:34:07Z","pushed_at":"2015-09-09T04:04:44Z","git_url":"git://github.com/cstoquer/AudioManager.git","ssh_url":"git@github.com:cstoquer/AudioManager.git","clone_url":"https://github.com/cstoquer/AudioManager.git","svn_url":"https://github.com/cstoquer/AudioManager","homepage":null,"size":126,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","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":"Wizcorp:master","ref":"master","sha":"9236a2969cce776d911e2428dcc6c572c0eb1e1d","user":{"login":"Wizcorp","id":592346,"avatar_url":"https://avatars.githubusercontent.com/u/592346?v=3","gravatar_id":"","url":"https://api.github.com/users/Wizcorp","html_url":"https://github.com/Wizcorp","followers_url":"https://api.github.com/users/Wizcorp/followers","following_url":"https://api.github.com/users/Wizcorp/following{/other_user}","gists_url":"https://api.github.com/users/Wizcorp/gists{/gist_id}","starred_url":"https://api.github.com/users/Wizcorp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Wizcorp/subscriptions","organizations_url":"https://api.github.com/users/Wizcorp/orgs","repos_url":"https://api.github.com/users/Wizcorp/repos","events_url":"https://api.github.com/users/Wizcorp/events{/privacy}","received_events_url":"https://api.github.com/users/Wizcorp/received_events","type":"Organization","site_admin":false},"repo":{"id":37699565,"name":"AudioManager","full_name":"Wizcorp/AudioManager","owner":{"login":"Wizcorp","id":592346,"avatar_url":"https://avatars.githubusercontent.com/u/592346?v=3","gravatar_id":"","url":"https://api.github.com/users/Wizcorp","html_url":"https://github.com/Wizcorp","followers_url":"https://api.github.com/users/Wizcorp/followers","following_url":"https://api.github.com/users/Wizcorp/following{/other_user}","gists_url":"https://api.github.com/users/Wizcorp/gists{/gist_id}","starred_url":"https://api.github.com/users/Wizcorp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Wizcorp/subscriptions","organizations_url":"https://api.github.com/users/Wizcorp/orgs","repos_url":"https://api.github.com/users/Wizcorp/repos","events_url":"https://api.github.com/users/Wizcorp/events{/privacy}","received_events_url":"https://api.github.com/users/Wizcorp/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Wizcorp/AudioManager","description":"play sounds using Web Audio, fallback on HTML5 Audio","fork":false,"url":"https://api.github.com/repos/Wizcorp/AudioManager","forks_url":"https://api.github.com/repos/Wizcorp/AudioManager/forks","keys_url":"https://api.github.com/repos/Wizcorp/AudioManager/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Wizcorp/AudioManager/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Wizcorp/AudioManager/teams","hooks_url":"https://api.github.com/repos/Wizcorp/AudioManager/hooks","issue_events_url":"https://api.github.com/repos/Wizcorp/AudioManager/issues/events{/number}","events_url":"https://api.github.com/repos/Wizcorp/AudioManager/events","assignees_url":"https://api.github.com/repos/Wizcorp/AudioManager/assignees{/user}","branches_url":"https://api.github.com/repos/Wizcorp/AudioManager/branches{/branch}","tags_url":"https://api.github.com/repos/Wizcorp/AudioManager/tags","blobs_url":"https://api.github.com/repos/Wizcorp/AudioManager/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Wizcorp/AudioManager/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Wizcorp/AudioManager/git/refs{/sha}","trees_url":"https://api.github.com/repos/Wizcorp/AudioManager/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Wizcorp/AudioManager/statuses/{sha}","languages_url":"https://api.github.com/repos/Wizcorp/AudioManager/languages","stargazers_url":"https://api.github.com/repos/Wizcorp/AudioManager/stargazers","contributors_url":"https://api.github.com/repos/Wizcorp/AudioManager/contributors","subscribers_url":"https://api.github.com/repos/Wizcorp/AudioManager/subscribers","subscription_url":"https://api.github.com/repos/Wizcorp/AudioManager/subscription","commits_url":"https://api.github.com/repos/Wizcorp/AudioManager/commits{/sha}","git_commits_url":"https://api.github.com/repos/Wizcorp/AudioManager/git/commits{/sha}","comments_url":"https://api.github.com/repos/Wizcorp/AudioManager/comments{/number}","issue_comment_url":"https://api.github.com/repos/Wizcorp/AudioManager/issues/comments{/number}","contents_url":"https://api.github.com/repos/Wizcorp/AudioManager/contents/{+path}","compare_url":"https://api.github.com/repos/Wizcorp/AudioManager/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Wizcorp/AudioManager/merges","archive_url":"https://api.github.com/repos/Wizcorp/AudioManager/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Wizcorp/AudioManager/downloads","issues_url":"https://api.github.com/repos/Wizcorp/AudioManager/issues{/number}","pulls_url":"https://api.github.com/repos/Wizcorp/AudioManager/pulls{/number}","milestones_url":"https://api.github.com/repos/Wizcorp/AudioManager/milestones{/number}","notifications_url":"https://api.github.com/repos/Wizcorp/AudioManager/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Wizcorp/AudioManager/labels{/name}","releases_url":"https://api.github.com/repos/Wizcorp/AudioManager/releases{/id}","created_at":"2015-06-19T03:31:27Z","updated_at":"2015-08-28T07:35:31Z","pushed_at":"2015-09-09T04:26:07Z","git_url":"git://github.com/Wizcorp/AudioManager.git","ssh_url":"git@github.com:Wizcorp/AudioManager.git","clone_url":"https://github.com/Wizcorp/AudioManager.git","svn_url":"https://github.com/Wizcorp/AudioManager","homepage":null,"size":247,"stargazers_count":1,"watchers_count":1,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":1,"forks":1,"open_issues":1,"watchers":1,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Wizcorp/AudioManager/pulls/10"},"html":{"href":"https://github.com/Wizcorp/AudioManager/pull/10"},"issue":{"href":"https://api.github.com/repos/Wizcorp/AudioManager/issues/10"},"comments":{"href":"https://api.github.com/repos/Wizcorp/AudioManager/issues/10/comments"},"review_comments":{"href":"https://api.github.com/repos/Wizcorp/AudioManager/pulls/10/comments"},"review_comment":{"href":"https://api.github.com/repos/Wizcorp/AudioManager/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Wizcorp/AudioManager/pulls/10/commits"},"statuses":{"href":"https://api.github.com/repos/Wizcorp/AudioManager/statuses/899eb8264c73b8f983b8e597af351cf898003d02"}}}}