public static final class DefaultBandwidthMeter.Builder
extends java.lang.Object
| Constructor and Description |
|---|
Builder()
Deprecated.
Use
#Builder(Context) instead. |
Builder(android.content.Context context)
Creates a builder with default parameters and without listener.
|
| Modifier and Type | Method and Description |
|---|---|
DefaultBandwidthMeter |
build()
Builds the bandwidth meter.
|
DefaultBandwidthMeter.Builder |
setClock(Clock clock)
Sets the clock used to estimate bandwidth from data transfers.
|
DefaultBandwidthMeter.Builder |
setEventListener(android.os.Handler eventHandler,
BandwidthMeter.EventListener eventListener)
Sets an event listener for new bandwidth estimates.
|
DefaultBandwidthMeter.Builder |
setInitialBitrateEstimate(int networkType,
long initialBitrateEstimate)
Sets the initial bitrate estimate in bits per second for a network type that should be
assumed when a bandwidth estimate is unavailable and the current network connection is of the
specified type.
|
DefaultBandwidthMeter.Builder |
setInitialBitrateEstimate(long initialBitrateEstimate)
Sets the initial bitrate estimate in bits per second that should be assumed when a bandwidth
estimate is unavailable.
|
DefaultBandwidthMeter.Builder |
setInitialBitrateEstimate(java.lang.String countryCode)
Sets the initial bitrate estimates to the default values of the specified country.
|
DefaultBandwidthMeter.Builder |
setSlidingWindowMaxWeight(int slidingWindowMaxWeight)
Sets the maximum weight for the sliding window.
|
@Deprecated public Builder()
#Builder(Context) instead.public Builder(@Nullable
android.content.Context context)
context - A context.public DefaultBandwidthMeter.Builder setEventListener(android.os.Handler eventHandler, BandwidthMeter.EventListener eventListener)
eventHandler - A handler for events.eventListener - A listener of events.java.lang.IllegalArgumentException - If the event handler or listener are null.public DefaultBandwidthMeter.Builder setSlidingWindowMaxWeight(int slidingWindowMaxWeight)
slidingWindowMaxWeight - The maximum weight for the sliding window.public DefaultBandwidthMeter.Builder setInitialBitrateEstimate(long initialBitrateEstimate)
initialBitrateEstimate - The initial bitrate estimate in bits per second.public DefaultBandwidthMeter.Builder setInitialBitrateEstimate(@C.NetworkType int networkType, long initialBitrateEstimate)
networkType - The C.NetworkType this initial estimate is for.initialBitrateEstimate - The initial bitrate estimate in bits per second.public DefaultBandwidthMeter.Builder setInitialBitrateEstimate(java.lang.String countryCode)
countryCode - The ISO 3166-1 alpha-2 country code of the country whose default bitrate
estimates should be used.public DefaultBandwidthMeter.Builder setClock(Clock clock)
clock - The clock used to estimate bandwidth from data transfers.public DefaultBandwidthMeter build()