{"action":"created","issue":{"url":"https://api.github.com/repos/danielstern/ngAudio/issues/43","labels_url":"https://api.github.com/repos/danielstern/ngAudio/issues/43/labels{/name}","comments_url":"https://api.github.com/repos/danielstern/ngAudio/issues/43/comments","events_url":"https://api.github.com/repos/danielstern/ngAudio/issues/43/events","html_url":"https://github.com/danielstern/ngAudio/issues/43","id":53257030,"number":43,"title":"Weird global event handler installation in Constructor of NgAudioObject","user":{"login":"janv","id":25069,"avatar_url":"https://avatars.githubusercontent.com/u/25069?v=3","gravatar_id":"","url":"https://api.github.com/users/janv","html_url":"https://github.com/janv","followers_url":"https://api.github.com/users/janv/followers","following_url":"https://api.github.com/users/janv/following{/other_user}","gists_url":"https://api.github.com/users/janv/gists{/gist_id}","starred_url":"https://api.github.com/users/janv/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/janv/subscriptions","organizations_url":"https://api.github.com/users/janv/orgs","repos_url":"https://api.github.com/users/janv/repos","events_url":"https://api.github.com/users/janv/events{/privacy}","received_events_url":"https://api.github.com/users/janv/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":6,"created_at":"2015-01-02T15:07:42Z","updated_at":"2015-01-11T16:06:29Z","closed_at":null,"body":"Here: https://github.com/danielstern/ngAudio/blob/master/app/angular.audio.js#L101\r\n\r\nA global event handler for the click event installed with the result that:\r\n\r\n- After loading an audio-file and playing it, the first click _anywhere_ in the window stops playback\r\n- Sometimes, `audio` in the event handler becomes undefined, the click handler then causes errors. I have not been able to determine the exact circumstances for this.\r\n\r\nIs this some kind of mistake? If not, how can prevent global click events from pausing the playback?"},"comment":{"url":"https://api.github.com/repos/danielstern/ngAudio/issues/comments/69499465","html_url":"https://github.com/danielstern/ngAudio/issues/43#issuecomment-69499465","issue_url":"https://api.github.com/repos/danielstern/ngAudio/issues/43","id":69499465,"user":{"login":"danielstern","id":4268152,"avatar_url":"https://avatars.githubusercontent.com/u/4268152?v=3","gravatar_id":"","url":"https://api.github.com/users/danielstern","html_url":"https://github.com/danielstern","followers_url":"https://api.github.com/users/danielstern/followers","following_url":"https://api.github.com/users/danielstern/following{/other_user}","gists_url":"https://api.github.com/users/danielstern/gists{/gist_id}","starred_url":"https://api.github.com/users/danielstern/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/danielstern/subscriptions","organizations_url":"https://api.github.com/users/danielstern/orgs","repos_url":"https://api.github.com/users/danielstern/repos","events_url":"https://api.github.com/users/danielstern/events{/privacy}","received_events_url":"https://api.github.com/users/danielstern/received_events","type":"User","site_admin":false},"created_at":"2015-01-11T16:06:29Z","updated_at":"2015-01-11T16:06:29Z","body":"@janv That's fair. The behaviour is mostly implemented for this scenario:\r\n\r\nLet's say you're making an MP3 player app with a playlist. The user starts song one, and when he clicks play the event fires at the same time, allowing the song to play as expected. But when the next song starts, it won't play because it hasn't been \"unlocked.\" The user would have to click again to play the next song. This probably isn't the behavior the user will want.\r\n\r\nThe best solution here is to make the fix smarter, or add a flag allowing developers to disable this feature for certain files."}}