BandwidthMeter.EventListener


interface BandwidthMeter.EventListener

Known direct subclasses
AnalyticsCollector

Interface for data collectors that forward analytics events to AnalyticsListeners.

Known indirect subclasses
DefaultAnalyticsCollector

Data collector that forwards analytics events to AnalyticsListeners.


A listener of BandwidthMeter events.

Summary

Nested types

Event dispatcher which allows listener registration.

Public functions

Unit
onBandwidthSample(
    elapsedMs: Int,
    bytesTransferred: Long,
    bitrateEstimate: Long
)

Called periodically to indicate that bytes have been transferred or the estimated bitrate has changed.

Public functions

onBandwidthSample

fun onBandwidthSample(
    elapsedMs: Int,
    bytesTransferred: Long,
    bitrateEstimate: Long
): Unit

Called periodically to indicate that bytes have been transferred or the estimated bitrate has changed.

Note: The estimated bitrate is typically derived from more information than just bytesTransferred and elapsedMs.

Parameters
elapsedMs: Int

The time taken to transfer bytesTransferred, in milliseconds. This is at most the elapsed time since the last callback, but may be less if there were periods during which data was not being transferred.

bytesTransferred: Long

The number of bytes transferred since the last callback.

bitrateEstimate: Long

The estimated bitrate in bits/sec.