SubscriberKit.VideoStatsListener

public abstract static interface VideoStatsListener

Enclosing class: SubscriberKit

Defines the listener object for getting subscriber video statistics.

Methods

Name Description
onVideoQualityChanged(subscriber, stats, reason) Listener for quality-related video events for a subscriber.
onVideoStats(subscriber, stats) Called periodically to report video statistics for the subscriber.

onVideoQualityChanged(subscriber, stats, reason)

Listener for quality-related video events for a subscriber.

This callback is triggered when a significant quality-related event occurs in the subscriber’s video stream. Currently, it is primarily used to notify about long video interruptions (pauses) lasting 5 seconds or more.

Short freezes are tracked internally and reflected in the subscriber’s SubscriberVideoStats, but they do not trigger this callback due to their short duration and high frequency.

The reason parameter indicates the cause of the event, following this priority order:

  • VIDEO_REASON_INTERRUPTION
  • VIDEO_REASON_CODEC_CHANGE
  • VIDEO_REASON_RESOLUTION_CHANGE

Unlike the SubscriberKit.VideoListener#onVideoDisabled(SubscriberKit, String) and SubscriberKit.VideoListener#onVideoEnabled(SubscriberKit, String) methods, which are triggered when the video track itself is turned off or on (for example, due to audio fallback or stream property changes), this callback reports quality-related changes while the video remains enabled.

Applications can use this callback to update the UI, log telemetry, or notify users about video interruptions.

Parameters:
Name Type Description
subscriber SubscriberKit The subscriber whose video stream experienced the event.
stats SubscriberKit.SubscriberVideoStats The latest SubscriberVideoStats at the time of the event.
reason String The reason for the quality event

onVideoStats(subscriber, stats)

Called periodically to report video statistics for the subscriber.

Parameters:
Name Type Description
subscriber SubscriberKit The subscriber.
stats SubscriberKit.SubscriberVideoStats The video statistics.