How to use MediaPlugin correctly

According to usage guide of cordova-plugin-media says you can trigger action after playback has finished…

Unfortunately, i have tried every option available but doesn’t give me an alert when audio is done playing or an error occured, in my case, i want to play another audio as soon the current audio is done playing. I ran this on device… Please tell me where i am doing wrong…

i trigger play via ion-button with playNow($event)

import { Platform, AlertController } from 'ionic-angular'; 
import { MediaPlugin } from 'ionic-native';

@Component({
  selector: 'page-play',
  templateUrl: 'play.html'
})
export class PlayPage {

	constructor(public platform:Platform, public alertCtrl:AlertController) {}

	playNow(){
	   this.platform.ready().then(() => {
		const onStatusUpdate = (status) => console.log(status);
		const file = new MediaPlugin('path/to/file.mp3', onStatusUpdate);

		file.init.then(() => {
			//show alert playback finished..
			let alert = this.alertCtrl.create({
			  title: 'Info',
			  subTitle: 'Playback Finished',
			  buttons: ['Ok']
			});  
			alert.present();
		}, (err) => {
			//show alert on error..
			let alert = this.alertCtrl.create({
			  title: 'Info',
			  subTitle: 'Error Playing Audio',
			  buttons: ['Ok']
			});  
			alert.present();
		});

		file.play();
	   });
	}

}

Thank you so much.

Any solution please… I am stuck…

My approach is slightly different:

const onStatusUpdate = (status) => console.log(status);
...
record(audio_id: number): Promise<MediaObject>{
    return this.media.create(full_path,onStatusUpdate).then((mediaObj) => {
        mediaObj.startRecord();
        return mediaObj;
    });
});

I do that and store the mediaObj elsewhere and then just provide the mediaObj on play, pause and other such functions. Sadly, I don’t know how to grab the onStatusUpdate function’s callbacks, but they’re being triggered, at least.