# RTMP onPause big delay

**URL:** https://community.wowza.com/t/rtmp-onpause-big-delay/45720
**Category:** Wowza Developer Dojo
**Tags:** wowza-streaming-server-java-api
**Created:** [April 18, 2016, 8:45am UTC](https://community.wowza.com/t/rtmp-onpause-big-delay/45720 "2016-04-18T08:45:53Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![Danijel\_Petrovic](https://avatars.discourse-cdn.com/v4/letter/d/a87d85/32.png) [@Danijel\_Petrovic](https://community.wowza.com/u/Danijel_Petrovic)
#### Post date: [April 18, 2016, 8:45am UTC](https://community.wowza.com/t/rtmp-onpause-big-delay/45720/1 "2016-04-18T08:45:53Z")

</div>

I’m experiencing very big delay between pause and firing onPause event for my RTMP streams. onPlay and onStop fires immediately.

In my custom module I have

```auto
public void onStreamCreate(IMediaStream stream) { userStream = new UserStream(stream, ...); }

```

in which I create new instance of a object that implements

```auto
UserStream implements IMediaStreamActionNotify

```

Then I attach client listener this way:

```auto
public UserStream(IMediaStream stream, ...){ this.stream.addClientListener((IMediaStreamActionNotify)this); }

```

and implement onPlay, onPause, onStop events. I don’t quite get why my onPause event only is so delayed. And I test using wowza test player.

---

<div class="post-metadata">

### Author: ![Matt\_Young](https://sea2.discourse-cdn.com/flex002/user_avatar/community.wowza.com/matt_young/32/389_2.png) [@Matt\_Young](https://community.wowza.com/u/Matt_Young)
#### Post date: [April 27, 2016, 6:36am UTC](https://community.wowza.com/t/rtmp-onpause-big-delay/45720/2 "2016-04-27T06:36:00Z")

</div>

Hello

You should take a look at the onPauseRaw event handler within the [IMediaStreamActionNotify2](https://www.wowza.com/docs/imediastreamactionnotify2-example) interface. This should fire immediately.

Thanks,

Matt
