samvera-labs / ramp

Interactive, IIIF powered audio/video media player React components library. Styleguidist Docs: https://samvera-labs.github.io/ramp/
https://ramp.avalonmediasystem.org/
30 stars 5 forks source link

[BUG] Playback does not begin when audio is muted on iOS (iPhone/iPad) #583

Open elynema opened 1 month ago

elynema commented 1 month ago

Describe the bug When the audio is muted, playback does not begin for audio only items on iOS (both iPhone and iPad). This was replicated in Safari, but reported to be observed across browsers.

To Reproduce Steps to reproduce the behavior:

  1. Go to https://avalon-staging.dlib.indiana.edu/media_objects/rf55z7692 on iPad or iPhone (iOS17) in Safari.
  2. Make sure volume is muted.
  3. Start playback.
  4. Audio will not start and the playback head will not move.
  5. Unmute volume.
  6. Playback will start with audio.
  7. Note: this can be intermittent. It seems to happen most reliably when the audio is already muted, so after page refresh after you have muted audio.

Expected behavior Playback should begin even if audio is muted.

Screenshots

https://github.com/user-attachments/assets/692ef80a-c472-45a5-9195-76b295aad56f

Smartphone (please complete the following information):

elynema commented 1 month ago

Could it possibly be a feature of iOS/Safari that playback of an audio item will not begin if it is muted?

Dananji commented 1 month ago

I tested the audio cookbook recipe in this specific environment, and it plays and updates the UI as expected with these settings.

Dananji commented 1 month ago

I tested with an audio manifest from one of Northwestern's collections, and observed the same behavior.

I tested this issue in Chrome on iOS in both iPhone and iPad, and observed the same behavior. In desktop browsers; both Firefox, Chrome played the media when muted but not Safari.

I was not able to find anything that explains this behavior in relation to Apple's system settings on the internet.

@elynema and @joncameron; One solution we could implement is unmute the audio player on page load in the environments we are seeing this behavior. What do you think?

elynema commented 1 month ago

In Safari, when audio is muted, it never gets to the point where the player is ready to play the media. Same issue when we were trying to activate the buttons in the iOS player b/c the player was not ready enough to have everything ready to play, even when the loaded metadata event has fired. Another event called 'canPlay' - ready state never reaches 4 in Safari when the audio is muted.