Detect error while playing video with XPMobileSDK (Javascript)

We are able to play the video when it is available. But, when we request a fragment from a determined timestamp and the recording is not available, the Mobile Server returns other video clip that is not the requested by the user.

This is not valid for us, and we want to know if there is any method to get an error similar to this one “The video requested is not available” or similar.

On method “RequestStream” there is an error callback, but in case the video does not exists, it is not firing this callback.

Thanks.

Hi Joaquin,

RequestStream/ChangeStream return the closest video frame around the requested time.

You can check if the actual frame time matches requested time by looking at its headers (headers are explained in this document).

More specifically, check that Main header’s Time Stamp UTC is close enough to Header Extension Playback Info’s RequestedTimeStampUtcMs. If those two differ more than than expected (e.g. more than a second), this means there’s no recordings at the requested time.

Another way to check if recordings are available at specific time is to use GetThumbnailByTime or GetSequences. Use those if you don’t already have a stream.