From b719a0372bdfbde162ec3945245f9d3c5e873ae9 Mon Sep 17 00:00:00 2001 From: Ibby Hadeed Date: Wed, 23 Nov 2016 08:05:04 -0500 Subject: [PATCH] fix(native-audio): completeCallback is optional on play method closes #792 --- src/plugins/native-audio.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/plugins/native-audio.ts b/src/plugins/native-audio.ts index 11588ec77..a6121d5fc 100644 --- a/src/plugins/native-audio.ts +++ b/src/plugins/native-audio.ts @@ -10,6 +10,10 @@ import { Plugin, Cordova } from './plugin'; * NativeAudio.preloadComplex('uniqueId2', 'path/to/file2.mp3', 1, 1, 0).then(onSuccess, onError); * * NativeAudio.play('uniqueId1').then(onSuccess, onError); + * + * // can optionally pass a callback to be called when the file is done playing + * NativeAudio.play('uniqueId1', () => console.log('uniqueId1 is done playing')); + * * NativeAudio.loop('uniqueId2').then(onSuccess, onError); * * NativeAudio.setVolumeForComplexAsset('uniqueId2', 0.6).then(onSuccess,onError); @@ -57,7 +61,7 @@ export class NativeAudio { successIndex: 1, errorIndex: 2 }) - static play(id: string, completeCallback: Function): Promise {return; } + static play(id: string, completeCallback?: Function): Promise {return; } /** * Stops playing an audio