cordova-plugin-nativeaudio
cordova-plugin-nativeaudio copied to clipboard
What is completeCallback
Why does the plugin have successCallback
, failureCallback
, and completeCallback
?
The README says it's an error callback. Then what how is it different form failureCallback
?
completeCallback is an optional callback to be called when the file is done playing. A simple implementation of "play" function with all three callbacks could be:
this.nativeAudio.play('audio1', () => { //completeCallback console.log('audio1 is done playing') }).then(() => { //successCallback console.log("Success callback for audio1") }, (err) => { //failureCallback console.log("Error callback for audio1: ", err) })