Wowza Community

HLS VOD streams not throwing stop events when the steam is over?

I’m playing a 5 second video clip through the “vod” application like so:


Then I wait for the “onStreamDestroy” event, but it doesn’t come ~5 seconds later when the video finishes playing on my client, like I expect. It happens 25 seconds after the end of the video.

In contrast, when I stream from vod over RTMP, the “destroy” and “disconnect” events are thrown right when I expect them to be thrown.

Is there anything I can do to listen for an event that says “the video has played to completion” when accessing a VOD HLS stream?

Perhaps as a work-around, I could read the duration of the video, start a timer, and then manually throw events when this timer is finished.

I guess that HLS streams are fundamentally different, where you can’t listen for these events since there is no two-way communication. This two-way communication exists with rtmp, but not with hls.


For your workaround, there is another post that discusses obtaining the duration for a given VOD asset. The two protocols are fundamentally different, as RTMP is an inherent streaming protocol, while HLS is an HTTP protocol. You can look into using ID3 tags in an HLS stream, although you will need client-side code to detect when these tags are encountered, and to then send back a notification to your Wowza server.