native-audio
native-audio copied to clipboard
Promise not resolve on NativeAudio.preload
Describe the bug Promise does not resolve on preloading Assets
To Reproduce
NativeAudio.preload({
assetId: 'sound.mp3',
assetPath: 'public/assets/sound.mp3',
audioChannelNum: 1,
isUrl: false,
})
.then(() => console.log('loaded'))
.catch(e => console.error(e))
Expected behavior Promise should be resolve or fail
Smartphone (please complete the following information):
- iOS 15
Additional context Add any other context about the problem here.
@jansgescheit Try to update the plugin to the latest version and verify this issue, if that doesn't help, try debugging the capacitor-community/native-audio -> preload
function in XCode.
@bazuka5801 thank you for reply
I'm using the latest version, and I've already struggled through the Xcode debugger. The call to call.resolve() is never reached, the method is exited one line before. Maybe also a quirk of the debugger in the async code.
Edit I may have found the problem, I call the preload method twice for the same asset, on the second call the Promise is no longer resolved or rejected
Im having the exact same issue, workarounds Im exploring are combination of unload
ing assets and manually tracking preloading.
It's strange. Sometimes it works, sometimes it doesn't, but it doesn't work at all when I have the livereload active.