Listen for ended event audio player

I am currently using the audio player and I was wondering how I would listen for the ended event so I can supply another url to the player to keep it playing. Thank You

**UPDATE**

I have this currently:
{
url: 'http://50.62.10.158/Music/party.mp3',
title: 'Play',
thumb: '',
xtype: 'audioplayer',
id: 'm_player',
margin: 20
}
where i get the audioplayer by

var m = Ext.ComponentQuery.query('#m_player')[0];
and set songs by m.items.items[0].setUrl("songUrl")

however m.items.items[0].getAudioComponent() does not work
AUDIOPLAYER

Submitted by ken On Friday, 18 July 2014.
Category: Sencha 2 Audio Player

[RESOLVED]

0
2 Answers.
 
Super User
laser

Re:Listen for ended event audio player

use this

var audioplayer = m.getAudioComponent(); 
audioplayer.getAudioComponent().on('ended', function(){  
console.log('on audio end')  
audioplayer.setUrl('new.mp3'); 
});
Submitted by Super User On Monday, 21 July 2014
0
This Answer has been Chosen as Best Answer
Super User
laser

Re:Listen for ended event audio player

"getAudioComponent" method of audioplayer return sencha audio component. you can use it as u need

audioplayer.getAudioComponent().on('ended', function(){ 
console.log('on audio end') 
});
Submitted by Super User On Friday, 18 July 2014
1
Question is marked as resolved.