mariokreitz / pokedex-v2

A project focused on implementing and showcasing the PokeAPI v2, providing a comprehensive and interactive platform for exploring Pokémon data, including species, abilities, moves, and more.
https://pokedex.mario-kreitz.dev/
MIT License
2 stars 1 forks source link

Info: Pokemon Cry Doesn't Play on Safari/iPhone #1

Open mariokreitz opened 2 months ago

mariokreitz commented 2 months ago

Bug Report: Pokemon Cry Doesn't Play

Description: When selecting a Pokémon and pressing the speaker button, the cry (sound) of the Pokémon does not play as expected.

Steps to Reproduce:

  1. Open the Pokedex-v2 app.
  2. Select any Pokémon from the list.
  3. Click on the speaker button (cry button) next to the Pokémon's name.
  4. Observe that no sound is played.

Expected Behavior: Upon clicking the speaker button, the Pokémon’s cry should play.

Actual Behavior: The Pokémon’s cry does not play when the speaker button is pressed.

Tested On:

Possible Cause: There might be an issue with the audio file not loading correctly or the event handler not triggering the sound.

Environment:

mariokreitz commented 2 months ago

Key Considerations for Safari Compatibility:

  1. Autoplay Restrictions: Safari on iOS requires user interaction (such as a tap or touch event) to play audio or video. This means that autoplay is disabled unless triggered by direct user input.

  2. Supported Audio Formats: The Pokémon cries retrieved from the PokeAPI are provided in .ogg format, which is not natively supported in iOS Safari. To ensure compatibility, you'll need to convert or use alternate formats like .mp3 or .m4a, which are supported across all major browsers, including Safari.

Make sure to update the audio handling logic to address both the autoplay restriction and the format compatibility for a smooth user experience on iOS.