Skip to content

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

@Luc45

Description

@Luc45

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Bug: Needs Confirmation 🧐Bugs that are reported, but needs to be confirmed and replicated.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions