channel; multi-channel apps should store results by channel. Public monitoring types are in cn.seastart.rtc.monitoring.api.
Local snapshots and FY server reports have different data sources and quality levels; do not combine their levels. See Media quality for the detailed models and units.
Listen for periodic local snapshots
snapshot.timestamp, snapshot.networkQuality.timestamp, and snapshot.mediaPlaybackExperience.timestamp match and use milliseconds. The interval starts after collection and delivery finish, so delivery is not fixed to an exact 2-second wall-clock schedule. Without valid samples, a network or playback level may be UNKNOWN and nullable measurements may be null. NetworkQuality contains both direction summaries and per-track results. Playback experience describes continuity of media received locally. Poor network quality does not always mean playback stalls, and smooth playback does not measure picture clarity.
Network levels are UNKNOWN, EXCELLENT, GOOD, POOR, BAD, and LOST. LOST applies only when ICE for an expected media track reaches FAILED; deliberate closure yields UNKNOWN. Video playback levels are UNKNOWN, SMOOTH, DEGRADED, and FROZEN; audio levels are UNKNOWN, CLEAR, DEGRADED, and INTERRUPTED. The per-track network score ranges from 0 to 100, is null when it cannot be evaluated, and is not a playback score.
Query detailed statistics on demand
getStats() call or advance the network or playback evaluation window. It returns null before a usable sample exists or after monitoring becomes unavailable; repeated queries of one sample return independent copies. sampleTimestampMs is the completion time. If another sample finishes after a snapshot callback, a later query may have a different timestamp. Check both channel and timestamp before combining the results. Per-track timestamp comes from RTCStats and differs from the top-level wall-clock time.
Detailed bitrates use bps, RTT and jitter use ms, and loss rates range from 0 to 1; packet, byte, and frame counts are cumulative. null means unavailable, while a measured zero stays 0. Some direction totals are 0 when no tracks exist; that does not imply a measured zero for a particular track.
FY server reports
STABLE when the level is unchanged; the SDK does not apply app-level debouncing. report contains server statistics for both directions. getMetric().qualityReport also holds a recent FY server report, but it is read when detailed statistics are first assembled for that sample and need not be synchronized exactly with a particular server callback. For WS, qualityReport is null. Callbacks run on an SDK background thread; switch to the main thread before updating UI.
Handle poor networks
First identify the affected channel, direction, and track. Use direction levels for status displays, thenremoteTracks, localTracks, and playback lists to locate affected tracks. Apps should choose persistence and recovery conditions for prompts or automatic degradation based on their use case; a single POOR or BAD sample does not by itself require stopping video. For connection state changes, see RTCClientEvent.