Skip to content

fix: Audio block iOS file picker compatibility #137

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 20, 2025

Conversation

dcalhoun
Copy link
Member

@dcalhoun dcalhoun commented May 19, 2025

What?

Apply a workaround so that the Audio block allows audio files within iOS' file picker.

Why?

A iOS Safari limitation currently prevents selecting audio files for upload.

Fix CMM-343. Fix #123. Related: WordPress/gutenberg#70119.

How?

iOS Safari's accept attribute lacks wildcard audio/* support. We instead
provide an explicit list of audio MIME types.

This patch can be removed once the issue
is addressed in a future release.

See: https://stackoverflow.com/a/66859581

Testing Instructions

Tip

Test using the prototype build in wordpress-mobile/WordPress-iOS#24552.

Important

Utilize a hosting plan that allows for uploading audio.

  1. On an iOS device, insert an Audio block.
  2. Tap Upload.
  3. Select an MP3 file to upload.
  4. Verify the upload succeeds.

Accessibility Testing Instructions

N/A, no navigation changes.

Screenshots or screencast

N/A, no visual changes.

@dcalhoun dcalhoun added the [Type] Bug An existing feature does not function as intended label May 19, 2025
@dcalhoun dcalhoun force-pushed the fix/audio-block-ios-file-picker branch from 2585fc7 to a749a94 Compare May 19, 2025 18:26
iOS Safari's `accept` attribute lacks wildcard `audio/*` support. This
patch can be removed once [the issue](WordPress/gutenberg#70119)
is addressed in a future release.

See: https://stackoverflow.com/a/66859581
@dcalhoun dcalhoun force-pushed the fix/audio-block-ios-file-picker branch from a749a94 to e08f199 Compare May 19, 2025 18:28
@dcalhoun dcalhoun marked this pull request as ready for review May 19, 2025 18:55
@dcalhoun dcalhoun force-pushed the fix/audio-block-ios-file-picker branch from dbdbc63 to e08f199 Compare May 19, 2025 19:28
@dcalhoun dcalhoun requested a review from nbradbury May 19, 2025 20:21
@dcalhoun
Copy link
Member Author

@nbradbury contrary to Android, iOS does not publish build output in a CI task until we complete #45. So, I took the liberty of prepping an installable prototype build in wordpress-mobile/WordPress-iOS#24552.

Also, be sure to utilize a hosting plan that supports audio uploads when testing—e.g., WordPress.com Premium and above.

Lastly, the failed android-publish-android-library task can be safely ignored. It is a result of force pushing to remove temporary commits for creating an iOS build.

Copy link
Contributor

@nbradbury nbradbury left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@dcalhoun This worked as expected, but I did want to note that the file picker let me choose MP4 files, and if I do that I'm told "Sorry, this file type is not a supported type." :shipit:

@dcalhoun
Copy link
Member Author

[...] I did want to note that the file picker let me choose MP4 files, and if I do that I'm told "Sorry, this file type is not a supported type."

Thanks for the note. I noticed this odd behavior as well. It also occurs in the web editor, so I plan to research addressing that later.

@dcalhoun dcalhoun merged commit 76f01d3 into trunk May 20, 2025
9 of 11 checks passed
@dcalhoun dcalhoun deleted the fix/audio-block-ios-file-picker branch May 20, 2025 17:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Type] Bug An existing feature does not function as intended
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Audio block unable to upload expected file formats
2 participants