Title: [Plugin: Audio Player] Adding an event listener
Last modified: August 19, 2016

---

# [Plugin: Audio Player] Adding an event listener

 *  [cbarnardo](https://wordpress.org/support/users/cbarnardo/)
 * (@cbarnardo)
 * [16 years ago](https://wordpress.org/support/topic/plugin-audio-player-adding-an-event-listener/)
 * Hello,
 * I am trying to add an event listener that will send a notification when the player
   is started
 *  AudioPlayer.embed(“audioplayer”, {
    soundFile: soundfile, titles: title, artists:
   artist, });
 *  AudioPlayer.addListener(“audioplayer”, “PLAY”, function() {alert(“playing”)});
 * but I am getting this error
 * getPlayer(playerID) is undefined
    getPlayer(playerID).addListener(type, func);
 * Any ideas? I see its supported in the code but I can not find any docs on how
   to do it. Any help would be greatly appreciated. This is with the standalone 
   player.
 * Barnardo

Viewing 1 replies (of 1 total)

 *  [stereoscott](https://wordpress.org/support/users/stereoscott/)
 * (@stereoscott)
 * [15 years, 10 months ago](https://wordpress.org/support/topic/plugin-audio-player-adding-an-event-listener/#post-1496016)
 * Just ran into this same error tonight. [@cbarnardo](https://wordpress.org/support/users/cbarnardo/),
   did you find a solution?

Viewing 1 replies (of 1 total)

The topic ‘[Plugin: Audio Player] Adding an event listener’ is closed to new replies.

 * 1 reply
 * 2 participants
 * Last reply from: [stereoscott](https://wordpress.org/support/users/stereoscott/)
 * Last activity: [15 years, 10 months ago](https://wordpress.org/support/topic/plugin-audio-player-adding-an-event-listener/#post-1496016)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
