# How to write a custom event and a custom event listener in Wowza

**URL:** <https://community.wowza.com/t/how-to-write-a-custom-event-and-a-custom-event-listener-in-wowza/92176>\
**Category:** Wowza Developer Dojo\
**Tags:** wowza-streaming-server-java-api\
**Created:** [October 20, 2020, 2:12pm UTC](https://community.wowza.com/t/how-to-write-a-custom-event-and-a-custom-event-listener-in-wowza/92176 "2020-10-20T14:12:55Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Alok\_Kumar2](https://avatars.discourse-cdn.com/v4/letter/a/3ec8ea/32.png) [@Alok\_Kumar2](https://community.wowza.com/u/Alok_Kumar2)\
**Post date:** [October 20, 2020, 2:12pm UTC](https://community.wowza.com/t/how-to-write-a-custom-event-and-a-custom-event-listener-in-wowza/92176/1 "2020-10-20T14:12:55Z")

</div>

Hi,

I am extending Wowza to meet a custom use-case. I have used server modules. event listeners and HTTPProviders to meet our requirements. I had couple of questions which I wanted to ask the Wowza Developer team.

**How to write a custom event :**  
let’s say that I want to create an event which is triggered anytime a packet loss is detected in the stream (_ **onPacketLoss** _) or an event which is triggered when a VideoOnly stream is detected (_ **onVideoOnlyStream** _). How do I write these custom events in Wowza ?

**How to write a custom event listener**  
Consider the `IMediaStreamActionNotify3` event listener, it listens for stream events such as  
`onPlay`, `onPublish`,`onCodecInfoAudio` etc. How do I extend this event listener to create a `IMediaStreamActionNotify3Custom` which will also listen for custom stream events also such as `onPacketLoss` and `onVideoOnlyStream` ?

Regards,  
Alok Kumar

---

<div class="post-metadata">

**Author:** ![Rose\_Power-Wowza\_Com](https://sea2.discourse-cdn.com/flex002/user_avatar/community.wowza.com/rose_power-wowza_com/32/431_2.png) [@Rose\_Power-Wowza\_Com](https://community.wowza.com/u/Rose_Power-Wowza_Com)\
**Post date:** [October 20, 2020, 4:09pm UTC](https://community.wowza.com/t/how-to-write-a-custom-event-and-a-custom-event-listener-in-wowza/92176/2 "2020-10-20T16:09:22Z")

</div>

Hello @Alok\_Kumar2m these are great questions and the Wowza technical support team would be happy to answer them for you. They do not visit the community forum on a regular basis so the best way to get direct answers and code samples from the Wowza engineers is in a support ticket. They will work directly with you to customize your event listeners.

You can submit one here and I wish you great success!  
`https://www.wowza.com/support/open-ticket`
