@UnstableApi
interface BandwidthMeter

Known direct subclasses
DefaultBandwidthMeter

Estimates bandwidth by listening to data transfers.

ExperimentalBandwidthMeter

An experimental BandwidthMeter that estimates bandwidth by listening to data transfers.


Provides estimates of the currently available bandwidth.

Summary

Nested types

A listener of BandwidthMeter events.

Event dispatcher which allows listener registration.

Public functions

Unit
addEventListener(
    eventHandler: Handler!,
    eventListener: BandwidthMeter.EventListener!
)

Adds an EventListener.

Long

Returns the estimated bitrate.

Long

Returns the estimated time to first byte, in microseconds, or TIME_UNSET if no estimate is available.

TransferListener?

Returns the TransferListener that this instance uses to gather bandwidth information from data transfers.

Unit

Removes an EventListener.

Public functions

addEventListener

fun addEventListener(
    eventHandler: Handler!,
    eventListener: BandwidthMeter.EventListener!
): Unit

Adds an EventListener.

Parameters
eventHandler: Handler!

A handler for events.

eventListener: BandwidthMeter.EventListener!

A listener of events.

getBitrateEstimate

fun getBitrateEstimate(): Long

Returns the estimated bitrate.

getTimeToFirstByteEstimateUs

fun getTimeToFirstByteEstimateUs(): Long

Returns the estimated time to first byte, in microseconds, or TIME_UNSET if no estimate is available.

getTransferListener

fun getTransferListener(): TransferListener?

Returns the TransferListener that this instance uses to gather bandwidth information from data transfers. May be null if the implementation does not listen to data transfers.

removeEventListener

fun removeEventListener(eventListener: BandwidthMeter.EventListener!): Unit

Removes an EventListener.

Parameters
eventListener: BandwidthMeter.EventListener!

The listener to be removed.