cordova-plugin-nativeaudio icon indicating copy to clipboard operation
cordova-plugin-nativeaudio copied to clipboard

What is completeCallback

Open sungwoncho opened this issue 8 years ago • 1 comments

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?

sungwoncho avatar Nov 19 '15 06:11 sungwoncho

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) })

khushbu-mulani avatar Mar 23 '20 07:03 khushbu-mulani