Back to Exoplayer

BandwidthEstimator (ExoPlayer library)

docs/doc/reference/com/google/android/exoplayer2/upstream/experimental/BandwidthEstimator.html

latest5.7 KB
Original Source

Package com.google.android.exoplayer2.upstream.experimental

Interface BandwidthEstimator

  • All Known Implementing Classes:CombinedParallelSampleBandwidthEstimator, SplitParallelSampleBandwidthEstimator

[@Deprecated](https://developer.android.com/reference/java/lang/Deprecated.html "class or interface in java.lang")public interfaceBandwidthEstimator

Deprecated. com.google.android.exoplayer2 is deprecated. Please migrate to androidx.media3 (which contains the same ExoPlayer code). See the migration guide for more details, including a script to help with the migration.

The interface for different bandwidth estimation strategies.

Field Summary

Fields | Modifier and Type | Field | Description | | --- | --- | --- | | static long | ESTIMATE_NOT_AVAILABLE | Deprecated. |

Method Summary

All Methods Instance Methods Abstract Methods Deprecated Methods | Modifier and Type | Method | Description | | --- | --- | --- | | void | addEventListener​(Handler eventHandler, BandwidthMeter.EventListener eventListener) | Deprecated.

Adds an BandwidthMeter.EventListener. | | long | getBandwidthEstimate() | Deprecated.

Returns the bandwidth estimate in bits per second, or ESTIMATE_NOT_AVAILABLE if there is no estimate available yet. | | void | onBytesTransferred​(DataSource source, int bytesTransferred) | Deprecated.

Called incrementally during a transfer. | | void | onNetworkTypeChange​(long newBandwidthEstimate) | Deprecated.

Notifies this estimator that a network change has been detected. | | void | onTransferEnd​(DataSource source) | Deprecated.

Called when a transfer ends. | | void | onTransferInitializing​(DataSource source) | Deprecated.

Called when a transfer is being initialized. | | void | onTransferStart​(DataSource source) | Deprecated.

Called when a transfer starts. | | void | removeEventListener​(BandwidthMeter.EventListener eventListener) | Deprecated.

Removes an BandwidthMeter.EventListener. |

Field Detail

- 

ESTIMATE_NOT_AVAILABLE

static final long ESTIMATE_NOT_AVAILABLE

Deprecated. See Also:Constant Field Values

Method Detail

- 

addEventListener

void addEventListener​([Handler](https://developer.android.com/reference/android/os/Handler.html "class or interface in android.os")eventHandler,[BandwidthMeter.EventListener](../BandwidthMeter.EventListener.html "interface in com.google.android.exoplayer2.upstream")eventListener)

Deprecated.

Adds an BandwidthMeter.EventListener. Parameters:eventHandler - A handler for events.eventListener - A listener of events.

- 

removeEventListener

void removeEventListener​([BandwidthMeter.EventListener](../BandwidthMeter.EventListener.html "interface in com.google.android.exoplayer2.upstream")eventListener)

Deprecated.

Removes an BandwidthMeter.EventListener. Parameters:eventListener - The listener to be removed.

- 

onTransferInitializing

void onTransferInitializing​([DataSource](../DataSource.html "interface in com.google.android.exoplayer2.upstream")source)

Deprecated.

Called when a transfer is being initialized. Parameters:source - The DataSource performing the transfer.

- 

onTransferStart

void onTransferStart​([DataSource](../DataSource.html "interface in com.google.android.exoplayer2.upstream")source)

Deprecated.

Called when a transfer starts. Parameters:source - The DataSource performing the transfer.

- 

onBytesTransferred

void onBytesTransferred​([DataSource](../DataSource.html "interface in com.google.android.exoplayer2.upstream")source,
                        int bytesTransferred)

Deprecated.

Called incrementally during a transfer. Parameters:source - The DataSource performing the transfer.bytesTransferred - The number of bytes transferred since the previous call to this method

- 

onTransferEnd

void onTransferEnd​([DataSource](../DataSource.html "interface in com.google.android.exoplayer2.upstream")source)

Deprecated.

Called when a transfer ends. Parameters:source - The DataSource performing the transfer.

- 

getBandwidthEstimate

long getBandwidthEstimate()

Deprecated.

Returns the bandwidth estimate in bits per second, or ESTIMATE_NOT_AVAILABLE if there is no estimate available yet.

- 

onNetworkTypeChange

void onNetworkTypeChange​(long newBandwidthEstimate)

Deprecated.

Notifies this estimator that a network change has been detected. Parameters:newBandwidthEstimate - The new initial bandwidth estimate based on network type.