Genvid Forum

Genvid Technologies

Find out about destroyed streams


Is there a way to find out whether or not a stream has been destroyed on the JavaScript-side?

We create a stream for each player to decouple state-updates. If a player disconnects, we simply destroy their stream - but never check on it again on the JavaScript-side, so the last update will always be displayed in our UI. Is there a way to mitigate it?

Or should I implement something like that using an annotation on an event-channel?


Hi Moritz,

Our team is currently investigating this behavior and we will have an answer for you shortly.



Hi Moritz, and thanks for your contributions to the forum

Our rule for synchronization on the JS side (onDraw()) is to find the youngest data frame that is not younger than the current video frame, and we always keep at least one in our queue. That means that in case the stream has been destroyed, there will always be a remaining data frame that may be sent to onDraw. This behaviour is necessary because every stream has its own update frequency, so we can’t expect a stream to be updated at every frames.
Actually, we plan to add the concept of closing a stream, and the ability to retrieve that information on the web API, but because of some limitations in our current data stream pipeline, we can’t support it right now.
To conclude, using the annotations is the most relevant way of addressing that need for now.


You can check by yourself if a data frame is not too old by having a look at the timecode of the frame data specifically.