8000 fix: restore Safari audio playback and retryable music controls by fhyfr · Pull Request #106 · dewanakl/undangan · GitHub
[go: up one dir, main page]

Skip to content

fix: restore Safari audio playback and retryable music controls - #106

Open
fhyfr wants to merge 1 commit into
dewanakl:4.xfrom
fhyfr:fix/safari-audio-playback
Open

fhyfr wants to merge 1 commit into
dewanakl:4.xfrom
fhyfr:fix/safari-audio-playback

Conversation

@fhyfr
@fhyfr fhyfr commented Nov 28, 2026
Copy link
Copy Markdown

Problem

On Safari/WebKit, loading the invitation music through the application cache's blob: URL can fail with MEDIA_ERR_SRC_NOT_SUPPORTED, even though the same MP3 plays when loaded from its original URL. The current code also leaves the music button disabled if audio.play() rejects, preventing the user from retrying playback.

This is reproducible against the current 4.x audio module and its bundled assets/music/pure-love-304010.mp3 in Playwright WebKit on Windows.

Changes

  • Assign the original audio URL after configuring the native audio element, allowing the browser to stream the file directly.
  • Remove the audio module's dependency on the blob cache and make initialization synchronous.
  • Handle media errors by hiding unavailable music controls without blocking the rest of the invitation.
  • Reset the button to its playable, enabled state when playback is rejected so the user can retry with another tap.
  • Guard optional music controls when registering listeners and opening the invitation.

Audio now relies on the browser's native HTTP/media caching instead of the application's forced blob cache.

Validation

  • Reproduced the failure on unmodified upstream 4.x (99e7c2d) using its actual audio/progress/cache modules and bundled MP3 in an isolated browser fixture with the cache pool initialized.
  • After the patch, the same external Playwright harness passed in Chromium (Desktop Chrome preset), Firefox, WebKit (Desktop Safari preset), and WebKit with iPhone 15 emulation: 4 passed.
  • Verified playback after a user opens the invitation, advancing playback time, pause, and resume using the real HTMLAudioElement without mocking successful playback.
  • ESLint passed for js/app/guest/audio.js.
  • The minified esbuild build passed for js/*.js.

The browser tests ran on Windows; this does not claim verification on a physical iPhone or macOS Safari. The temporary regression harness is external to this focused, single-file patch.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

0