Wowza Community

lifecycle of vod stream

currently, i’m using flowplayer to interact with wowza. i’ve also extended ModuleBase and enabled logging in all the overridden methods. i’ve noticed that the lifecycle for a VOD follows this pattern.

  • onConnect

  • onConnectAccept

  • onStreamCreate

  • onStreamDestroy

  • onDisconnect

    each time a user selects a movie to play, these steps are repeated with a new client id (e.g. IClient.getClientId()). what i’ve notice is that when the movie ends playing, onStreamDestroy and onDisconnect are not called immediately. it takes about a 2-3 minutes before these methods, corresponding to the client id, are called.

    how come onStreamDestroy and onDisconnect are not called immediately after a movie finishes playing? shouldn’t wowza know that the end of the stream has finished and make these callbacks?

    are there other callback methods that i may override to listen for the following events?

  • when a user stops (not pause) playing the stream

  • when a stream finishes (e.g. when a movie finishes playing)

    it seems when a user stops playing the stream, that’s a client side event, so i don’t really expect wowza to detect that. however, i would expect that wowza would detect when the end of a file is reached (when the file is finished streaming), since this is a server side event.

    any help is appreciated.

onDisconnect happens server-side when an RTMP client disconnect the NetConnection. In RTMP there is a NetStream that uses the NetConnection. The NetStream corresponds with onStreamCreate. Many pre-built players will disconnect the NetConnection when a stream end is detected, but not necessarily, it depends on the player and kind of streaming (vod or live) you are doing.

For more hooks into RTMP client/Wowza interaction, take a look at the IMediaStreamActionNotify3

Richard