Enclosing class: : PublisherKit


public static interface PublisherKit.VideoStatsListener

Defines the listener object for getting publisher video statistics.

See Also: : - PublisherKit.setVideoStatsListener(VideoStatsListener listener)

Method Summary

All MethodsInstance MethodsAbstract MethodsDefault Methods

Modifier and Type

Method

Description

default void

onVideoQualityChanged(PublisherKit publisher, PublisherKit.PublisherVideoStats stats, String reason)

Called whenever there is a change in the quality state of the publisher’s video stream.

void

onVideoStats(PublisherKit publisher, PublisherKit.PublisherVideoStats[] stats)

Called periodically to report video statistics for the publisher.

Method Details

onVideoStats

void onVideoStats(PublisherKit publisher, PublisherKit.PublisherVideoStats[] stats)

Called periodically to report video statistics for the publisher.

Parameters: : publisher - The publisher. : stats - An array of PublisherKit.PublisherVideoStats objects. For a publisher in a routed session (one that uses the OpenTok Media Router), this array includes one object, defining the statistics for the single video-media stream that is sent to the OpenTok Media Router. In a relayed session, the array includes an object for each subscriber to the published stream.

The [`PublisherKit.PublisherVideoStats`](publisherkit-publishervideostats) object includes properties.
properties for the video bytes received, video packets lost, and video
packets received for the publisher.

onVideoQualityChanged

default void onVideoQualityChanged(PublisherKit publisher, PublisherKit.PublisherVideoStats stats, String reason)

Called whenever there is a change in the quality state of the publisher’s video stream.

This method provides diagnostic information about video quality changes, including updated statistics and the reason why the event occurred.

The reason parameter indicates the cause of the event and follows this priority order: bandwidth degradation, CPU degradation, other quality degradation reasons, codec changes, and resolution or video layer changes.

Unlike PublisherKit.VideoListener.onVideoEnabled(PublisherKit, String) and PublisherKit.VideoListener.onVideoDisabled(PublisherKit, String), which indicate that the video track has been turned on or off (for example, due to a stream property update or audio fallback), this callback reports quality-related changes even when video remains enabled.

Applications can use this delegate to monitor quality changes and react accordingly — for example, by adjusting UI elements or triggering alerts.

Parameters: : publisher - The PublisherKit whose video stream quality has changed. : stats - Updated PublisherKit.PublisherVideoStats with details about resolution or video layer changes. : reason - The reason for the quality change