amplitudejs icon indicating copy to clipboard operation
amplitudejs copied to clipboard

Brave mobile: play() can only be initiated by a user gesture.

Open Luc45 opened this issue 2 years ago • 1 comments

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

  1. Initialize Amplitude.js with an audio player interface on a webpage.
  2. Confirm that Amplitude.js has been correctly initialized with play/pause controls linked to audio elements.
  3. Interact with the play/pause button on a mobile device running the Brave browser.
  4. 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

Luc45 avatar Nov 25 '23 13:11 Luc45

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.

sj64 avatar Mar 30 '25 10:03 sj64