{"action":"created","issue":{"url":"https://api.github.com/repos/CookPete/react-player/issues/249","repository_url":"https://api.github.com/repos/CookPete/react-player","labels_url":"https://api.github.com/repos/CookPete/react-player/issues/249/labels{/name}","comments_url":"https://api.github.com/repos/CookPete/react-player/issues/249/comments","events_url":"https://api.github.com/repos/CookPete/react-player/issues/249/events","html_url":"https://github.com/CookPete/react-player/issues/249","id":265135244,"number":249,"title":"Requires two clicks to play on iOS","user":{"login":"sarutole","id":3657107,"avatar_url":"https://avatars3.githubusercontent.com/u/3657107?v=4","gravatar_id":"","url":"https://api.github.com/users/sarutole","html_url":"https://github.com/sarutole","followers_url":"https://api.github.com/users/sarutole/followers","following_url":"https://api.github.com/users/sarutole/following{/other_user}","gists_url":"https://api.github.com/users/sarutole/gists{/gist_id}","starred_url":"https://api.github.com/users/sarutole/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sarutole/subscriptions","organizations_url":"https://api.github.com/users/sarutole/orgs","repos_url":"https://api.github.com/users/sarutole/repos","events_url":"https://api.github.com/users/sarutole/events{/privacy}","received_events_url":"https://api.github.com/users/sarutole/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2017-10-13T00:47:37Z","updated_at":"2018-04-10T19:16:08Z","closed_at":"2017-10-13T20:09:07Z","author_association":"NONE","body":"Please advice what is the right way to unlock <audio> element on user gesture as required by iOS. I have the following in my code (shortened for brevity), works without a hitch on Android/Windows/MacOS, but on iOS requires two clicks.\r\n\r\n```\r\n    componentDidMount() {\r\n        document.addEventListener('click', this.onPageClick);\r\n    }\r\n\r\n    componentWillUnmount() {\r\n        document.removeEventListener('click', this.onPageClick);\r\n    }\r\n\r\n    onPageClick(e){\r\n        const $el = $(e.target).closest('a[data-playable]');\r\n        const url = $el.attr('href')\r\n        \r\n        if( $el.length ){ //check if a \"playable\" link was clicked\r\n            e.preventDefault();\r\n            this.play(url);\r\n            return false;\r\n        }\r\n    }\r\n\r\n    play(url) {\r\n       const newState = {\r\n            url,\r\n            played: 0,\r\n            loaded: 0,\r\n            playing: true\r\n        };\r\n        this.setState(newState);\r\n    }\r\n\r\n```"},"comment":{"url":"https://api.github.com/repos/CookPete/react-player/issues/comments/380216304","html_url":"https://github.com/CookPete/react-player/issues/249#issuecomment-380216304","issue_url":"https://api.github.com/repos/CookPete/react-player/issues/249","id":380216304,"user":{"login":"sarutole","id":3657107,"avatar_url":"https://avatars3.githubusercontent.com/u/3657107?v=4","gravatar_id":"","url":"https://api.github.com/users/sarutole","html_url":"https://github.com/sarutole","followers_url":"https://api.github.com/users/sarutole/followers","following_url":"https://api.github.com/users/sarutole/following{/other_user}","gists_url":"https://api.github.com/users/sarutole/gists{/gist_id}","starred_url":"https://api.github.com/users/sarutole/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sarutole/subscriptions","organizations_url":"https://api.github.com/users/sarutole/orgs","repos_url":"https://api.github.com/users/sarutole/repos","events_url":"https://api.github.com/users/sarutole/events{/privacy}","received_events_url":"https://api.github.com/users/sarutole/received_events","type":"User","site_admin":false},"created_at":"2018-04-10T19:16:08Z","updated_at":"2018-04-10T19:16:08Z","author_association":"NONE","body":"@kpennell just adding that line to `fileConfig` fixed the issue for me. \r\nBut that was a while ago, I have not tested it with any recent version of react-player."}}
{"actor":{"display_login":"sarutole"}}