Native Media Playback Issue on iOS

#1

I am having a weird issue on iOS.

After I record audio using the Ionic Native Media plugin I am unable to play back the audio using the HTML5 audio API (WavesurferJS or HowlerJS).

If I close and reopen the app the sound will play. It is also bit weird that I can play it without closing the app if I play the audio simultaneously through the native Media plugin.

Any thoughts or direction is appreciated.

Thanks,
Andrew

#2

Is there any error logged when issue appears?
Could you give an example URI where you saved the audio file in ios?
How about in android?

I haven’t had chance to test in ios, but in android when playing audio with native Media plugin, the file path needs to tweak as this.recordPath.replace(/file:\/\//g, ""), otherwise it won’t recognize the URI. Does this apply to your problem?
ref: https://github.com/react-native-community/react-native-video/issues/213 [It is the same for ionic]

#3

Thanks, I already tried that.

I think this has more to do with the audio file not being released from when it was recording. If I close and open the app and try to play the audio using the same path it plays fine.