Back to Exoplayer

BandwidthMeter.EventListener (ExoPlayer library)

docs/doc/reference/com/google/android/exoplayer2/upstream/BandwidthMeter.EventListener.html

latest1.9 KB
Original Source

Package com.google.android.exoplayer2.upstream

Interface BandwidthMeter.EventListener

  • All Known Subinterfaces:AnalyticsCollectorAll Known Implementing Classes:DefaultAnalyticsCollectorEnclosing interface:BandwidthMeter

public static interfaceBandwidthMeter.EventListener

A listener of BandwidthMeter events.

Nested Class Summary

Nested Classes | Modifier and Type | Interface | Description | | --- | --- | --- | | static class | BandwidthMeter.EventListener.EventDispatcher | Event dispatcher which allows listener registration. |

Method Summary

All Methods Instance Methods Abstract Methods | Modifier and Type | Method | Description | | --- | --- | --- | | void | onBandwidthSample​(int elapsedMs, long bytesTransferred, long bitrateEstimate) | Called periodically to indicate that bytes have been transferred or the estimated bitrate has changed. |

Method Detail

- 

onBandwidthSample

void onBandwidthSample​(int elapsedMs,
                       long bytesTransferred,
                       long bitrateEstimate)

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 - 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 - The number of bytes transferred since the last callback.bitrateEstimate - The estimated bitrate in bits/sec.