Interface PublisherKit.VideoStatsListener
- Enclosing class:
- PublisherKit
-
Method Summary
Modifier and TypeMethodDescriptiondefault voidonVideoQualityChanged(PublisherKit publisher, PublisherKit.PublisherVideoStats stats, String reason) Called whenever there is a change in the quality state of the publisher’s video stream.voidonVideoStats(PublisherKit publisher, PublisherKit.PublisherVideoStats[] stats) Called periodically to report video statistics for the publisher.
-
Method Details
-
onVideoStats
Called periodically to report video statistics for the publisher.- Parameters:
publisher- The publisher.stats- An array ofPublisherKit.PublisherVideoStatsobjects. 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.PublisherVideoStatsobject 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
reasonparameter 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
Applications can use this delegate to monitor quality changes and react accordingly — for example, by adjusting UI elements or triggering alerts.PublisherKit.VideoListener.onVideoEnabled(PublisherKit, String)andPublisherKit.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.- Parameters:
publisher- ThePublisherKitwhose video stream quality has changed.stats- UpdatedPublisherKit.PublisherVideoStatswith details about resolution or video layer changes.reason- The reason for the quality change
-