Brave mobile: play() can only be initiated by a user gesture.
Issue Description
When triggering play/pause functionality on audio elements controlled by Amplitude.js within the Brave mobile browser, a DOMException is thrown with the message "play() can only be initiated by a user gesture." This issue is specific to the Brave mobile browser, where direct user interaction with play/pause controls is not recognized as a valid user gesture, leading to a failure to toggle playback as expected.
Expected Behavior
Audio should toggle between playing and pausing when the user interacts with Amplitude.js controls in Brave mobile.
Steps To Reproduce
- Initialize Amplitude.js with an audio player interface on a webpage.
- Confirm that Amplitude.js has been correctly initialized with play/pause controls linked to audio elements.
- Interact with the play/pause button on a mobile device running the Brave browser.
- Instead of toggling playback, a DOMException error appears in the browser console.
AmplitudeJS Version
5.3.2
Browser Information
https://www.whatsmybrowser.org/b/ITDGT
Link To Where Your Issue Can Be Reproduced
https://nova-acropole.org.br/podcast
Anything else?
No response
I know this is stale, and probably a niche issue, but found my way here because of the exact same problem with the Amplitude Player. To be clear: in other mobile browsers, everything works as expected. In Brave android, every other button works (next, previous, show/hide playlist etc, ONLY tapping Play button generates JS error NotAllowed play() can only be initiated by a user gesture. So in response to: BUG: Needs Confirmation...
Link To Where Your Issue Can Be Reproduced: https://www.envisioneer.net/media2/index.php?/category/94
Running: Brave 1.76.73, Chromium 134.0.6998.45 on Android 11. Amplitude 5.3.2.