-
Notifications
You must be signed in to change notification settings - Fork 1
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
Improve Safari compatibility #21
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That does improve things but does not fix playback. The call to decodeAudioData
still fails (with null
, not exactly easy to tell what happens). Digging things up, I believe the problem is the following:
- The recorder records media using
audio/webm
- The server stores that media with an
.mp3
extension. I suppose you were trying to confuse people there. Well, I confirm that it works, it took me some time to realize that the mp3 files were not mp3 files... - Safari can decode mp3, which these files are not, but it cannot decode webm, which these files actually are.
According to Can I Use, Safari supports the Opus codec used in the webM container, but only when packaged in a CAF container file (audio/x-caf
) which seems Apple specific.
Is there a common recording format across browsers that can also be decoded across browsers for playback?
I don't disagree that saving webm as mp3 is a tad confusing, but then surely URIs are opaque :) I tried getting a clear answer early on wrt common recording format, but failed to find one; I had assumed Mr Web Media would know. I guess we might have to add transcoding to the node server :( |
The codec question would also apply to recording presumably. Out of curiosity, how do you test in Safari? |
Well, it would if Safari supported MediaRecorder, which it apparently doesn't, although it seems an incomplete version was added to TP73 (but then shouldn't this be part of the latest e.g. iOS14 release?) There is a polyfill for the API: https://github.com/ai/audio-recorder-polyfill |
Even leaving Safari aside, I note implementations of
The old way. I have an iPad and just |
Between MP3 & WebM Follow up from #21
Between MP3 & WebM Follow up from #21
30193b4
to
851fec2
Compare
Between MP3 & WebM Follow up from #21
Player seems to work (provided that mp3 versions of the files are available). Recorder does not. I'll try to find out why. |
For recording, on top of the recorder itself, one issue is that Safari requires a user activation for Note Safari is also pretty aggressive at not loading media content to save network, so we'll probably want to call I suggest to handle recording in a separate PR. At least, this fixes playback. |
851fec2
to
27b6726
Compare
Updated without the recorder upgrade for now |
Previous play symbol did not render properly on Safari for iOS
No description provided.