{"action":"created","issue":{"url":"https://api.github.com/repos/danielstern/ngAudio/issues/161","repository_url":"https://api.github.com/repos/danielstern/ngAudio","labels_url":"https://api.github.com/repos/danielstern/ngAudio/issues/161/labels{/name}","comments_url":"https://api.github.com/repos/danielstern/ngAudio/issues/161/comments","events_url":"https://api.github.com/repos/danielstern/ngAudio/issues/161/events","html_url":"https://github.com/danielstern/ngAudio/issues/161","id":178158621,"number":161,"title":"Uncaught TypeError: Cannot read property 'play' of defined/play() request was interrupted by a call to pause()","user":{"login":"shusak","id":10942152,"avatar_url":"https://avatars3.githubusercontent.com/u/10942152?v=4","gravatar_id":"","url":"https://api.github.com/users/shusak","html_url":"https://github.com/shusak","followers_url":"https://api.github.com/users/shusak/followers","following_url":"https://api.github.com/users/shusak/following{/other_user}","gists_url":"https://api.github.com/users/shusak/gists{/gist_id}","starred_url":"https://api.github.com/users/shusak/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shusak/subscriptions","organizations_url":"https://api.github.com/users/shusak/orgs","repos_url":"https://api.github.com/users/shusak/repos","events_url":"https://api.github.com/users/shusak/events{/privacy}","received_events_url":"https://api.github.com/users/shusak/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":5,"created_at":"2016-09-20T19:40:08Z","updated_at":"2018-05-08T08:01:10Z","closed_at":"2016-10-14T15:42:52Z","author_association":"NONE","body":"I have ngAudio injected into a controller then use ngAudio.play(link to sound file), but I'm calling a method on my controller from a ng-click event because I have to do work along with the sound being played (think a phone dialpad)\n\nWhen called this way I get two errors in the Chrome (53.0.2785.116) Developer console :\n\n\"Uncaught TypeError: cannot read property 'play' of undefined\" that is then followed by the error \"Uncaught (in promise) DOMException: The play() request was interrupted by a call to pause().\"\n\nThe uncaught is in the function twiddle() on the line audio.play() inside the addEventListener for \"click\". \n\nSo I'm guessing I'm using it wrong or found a weird case here... \n\nMy code in HTML:\n\n``` html\n<span class=\"littleLeftPadding\" ng-click=\"::dialpad.addToDial(0, '../assets/dtmf-0.mp3')\" id=\"btnZero\" ng-disabled=\"btnZero\"><div class=\"num-text\">0</div></span>\n```\n\nInside my dialpadController:\n\n``` JavaScript\n  self.addToDial = function(digit, sound) {\n      ngAudio.play(sound);\n      callService.currentCall.phoneNumber.append(digit);\n  };\n```\n"},"comment":{"url":"https://api.github.com/repos/danielstern/ngAudio/issues/comments/387319035","html_url":"https://github.com/danielstern/ngAudio/issues/161#issuecomment-387319035","issue_url":"https://api.github.com/repos/danielstern/ngAudio/issues/161","id":387319035,"user":{"login":"deliverymanager","id":4013348,"avatar_url":"https://avatars3.githubusercontent.com/u/4013348?v=4","gravatar_id":"","url":"https://api.github.com/users/deliverymanager","html_url":"https://github.com/deliverymanager","followers_url":"https://api.github.com/users/deliverymanager/followers","following_url":"https://api.github.com/users/deliverymanager/following{/other_user}","gists_url":"https://api.github.com/users/deliverymanager/gists{/gist_id}","starred_url":"https://api.github.com/users/deliverymanager/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/deliverymanager/subscriptions","organizations_url":"https://api.github.com/users/deliverymanager/orgs","repos_url":"https://api.github.com/users/deliverymanager/repos","events_url":"https://api.github.com/users/deliverymanager/events{/privacy}","received_events_url":"https://api.github.com/users/deliverymanager/received_events","type":"User","site_admin":false},"created_at":"2018-05-08T08:01:10Z","updated_at":"2018-05-08T08:01:10Z","author_association":"NONE","body":"https://developers.google.com/web/updates/2017/06/play-request-was-interrupted"}}
{"actor":{"display_login":"deliverymanager"}}