iOS can't play audio when there is no file extension in the url
See original GitHub issue🐛 Bug Report
I recently changed my file url to a id-based url. This caused iOS to fail playing audio with an error:
Error: An unknown error occurred (1869640813) - The AVPlayerItem instance has failed with the error code -11800 and domain “AVFoundationErrorDomain”.
Android works fine without the extension, ironically, I need a overrideFileExtensionIOS
instead of overrideFileExtensionAndroid
.
Both urls return a Content-Type: audio/mpeg
header.
Summary of Issue
When playing an .m4a audio with no extension I get this error:
Error: An unknown error occurred (1869640813) - The AVPlayerItem instance has failed with the error code -11800 and domain “AVFoundationErrorDomain”.
Environment - output of expo diagnostics
& the platform(s) you’re targeting
This happens with Expo SDK 37 and so far with any iPhone model
Steps to Reproduce
const sound = new Audio.Sound();
sound.loadAsync({
uri: 'https//server.com/audiofile/download'
}) // throws error
sound.loadAsync({
uri: 'https//server.com/audiofile/download.m4a'
}) // all good
Expected Behavior vs Actual Behavior
Audio should play
Issue Analytics
- State:
- Created 3 years ago
- Reactions:4
- Comments:11 (5 by maintainers)
Top Results From Across the Web
How to play movie files with no file extension on iOS ...
I've successfully used MPMoviePlayerController and AVPlayer to load files from a remote URL when the filename has a file extension. However, when I...
Read more >If an audio or video file doesn't play on Mac
If that happens, your app won't open the file or won't play back its audio or video. How to search for an app...
Read more >The Embed Audio element - HTML - MDN Web Docs - Mozilla
The HTML element is used to embed sound content in documents. It may contain one or more audio sources, represented using the src...
Read more >How to FIX “greyed out” MP3/audio files in GarageBand iPad ...
How to convert MP3 audio files that are "greyed out" in GarageBand iOS ( iPad / iPhone ) and import them ... Your...
Read more >The 10 Most Common Audio Formats: Which One Should ...
You know about MP3, but what about AAC, FLAC, OGG, or WMA? Why do so many audio file formats exist and is there...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Hey, could you give some more details on how you solved this? I’m struggling with the issue with Cloudfront signed URLs without file extensions.
Is there Anyone Who have found a solution for this issue, it’s still occurring.