DefaultPreloadManager.Builder


class DefaultPreloadManager.Builder : BasePreloadManager.BuilderBase


A builder for DefaultPreloadManager instances.

Summary

Public constructors

Builder(
    context: Context!,
    targetPreloadStatusControl: TargetPreloadStatusControl<Int!>!
)

Creates a builder.

Public functions

DefaultPreloadManager!

Builds a DefaultPreloadManager instance.

ExoPlayer!

Builds an ExoPlayer.

ExoPlayer!
buildExoPlayer(exoPlayerBuilder: ExoPlayer.Builder!)

Builds an ExoPlayer with an ExoPlayer.Builder passed in.

DefaultPreloadManager.Builder!

Sets the BandwidthMeter that will be used by the built DefaultPreloadManager and ExoPlayer.

DefaultPreloadManager.Builder!

Sets the LoadControl that will be used by the built DefaultPreloadManager and ExoPlayer.

DefaultPreloadManager.Builder!

Sets the MediaSource.Factory that will be used by the built and ExoPlayer.

DefaultPreloadManager.Builder!

Sets the Looper that will be used for preload and playback.

DefaultPreloadManager.Builder!

Sets the RenderersFactory that will be used by the built and ExoPlayer.

DefaultPreloadManager.Builder!

Sets the TrackSelector.Factory that will be used by the built and ExoPlayer.

Public constructors

Builder

Builder(
    context: Context!,
    targetPreloadStatusControl: TargetPreloadStatusControl<Int!>!
)

Creates a builder.

Parameters
context: Context!

A Context.

targetPreloadStatusControl: TargetPreloadStatusControl<Int!>!

A <.

Public functions

build

fun build(): DefaultPreloadManager!

Builds a DefaultPreloadManager instance.

Throws
java.lang.IllegalStateException

If this method has already been called.

buildExoPlayer

fun buildExoPlayer(): ExoPlayer!

Builds an ExoPlayer.

See buildExoPlayer for the list of values populated on and resulting from this builder that the built ExoPlayer uses.

For the other configurations than above, the built ExoPlayer uses the default values, see Builder for the list of default values.

Returns
ExoPlayer!

An ExoPlayer instance.

buildExoPlayer

fun buildExoPlayer(exoPlayerBuilder: ExoPlayer.Builder!): ExoPlayer!

Builds an ExoPlayer with an ExoPlayer.Builder passed in.

The built ExoPlayer uses the following values populated on and resulting from this builder:

For the other configurations than above, the built ExoPlayer uses the values from the passed ExoPlayer.Builder.

Parameters
exoPlayerBuilder: ExoPlayer.Builder!

An ExoPlayer.Builder that is used to build the .

Returns
ExoPlayer!

An ExoPlayer instance.

setBandwidthMeter

@CanIgnoreReturnValue
fun setBandwidthMeter(bandwidthMeter: BandwidthMeter!): DefaultPreloadManager.Builder!

Sets the BandwidthMeter that will be used by the built DefaultPreloadManager and ExoPlayer.

The default is a DefaultBandwidthMeter.

Parameters
bandwidthMeter: BandwidthMeter!

A BandwidthMeter.

Returns
DefaultPreloadManager.Builder!

This builder.

Throws
java.lang.IllegalStateException

If build, buildExoPlayer or buildExoPlayer has already been called.

setLoadControl

@CanIgnoreReturnValue
fun setLoadControl(loadControl: LoadControl!): DefaultPreloadManager.Builder!

Sets the LoadControl that will be used by the built DefaultPreloadManager and ExoPlayer.

The default is a DefaultLoadControl.

Parameters
loadControl: LoadControl!

A LoadControl.

Returns
DefaultPreloadManager.Builder!

This builder.

Throws
java.lang.IllegalStateException

If build, buildExoPlayer or buildExoPlayer has already been called.

setMediaSourceFactory

@CanIgnoreReturnValue
fun setMediaSourceFactory(mediaSourceFactory: MediaSource.Factory!): DefaultPreloadManager.Builder!

Sets the MediaSource.Factory that will be used by the built and ExoPlayer.

The default is a DefaultMediaSourceFactory.

Parameters
mediaSourceFactory: MediaSource.Factory!

A MediaSource.Factory

Returns
DefaultPreloadManager.Builder!

This builder.

Throws
java.lang.IllegalStateException

If build, buildExoPlayer or buildExoPlayer has already been called.

setPreloadLooper

@CanIgnoreReturnValue
fun setPreloadLooper(preloadLooper: Looper!): DefaultPreloadManager.Builder!

Sets the Looper that will be used for preload and playback.

The backing thread should run with priority THREAD_PRIORITY_AUDIO and should handle messages within 10ms.

The default is a looper that is associated with a new thread created internally.

Parameters
preloadLooper: Looper!

A Looper.

Returns
DefaultPreloadManager.Builder!

This builder.

Throws
java.lang.IllegalStateException

If build, buildExoPlayer or buildExoPlayer has already been called.

setRenderersFactory

@CanIgnoreReturnValue
fun setRenderersFactory(renderersFactory: RenderersFactory!): DefaultPreloadManager.Builder!

Sets the RenderersFactory that will be used by the built and ExoPlayer.

The default is a DefaultRenderersFactory.

Parameters
renderersFactory: RenderersFactory!

A RenderersFactory.

Returns
DefaultPreloadManager.Builder!

This builder.

Throws
java.lang.IllegalStateException

If build, buildExoPlayer or buildExoPlayer has already been called.

setTrackSelectorFactory

@CanIgnoreReturnValue
fun setTrackSelectorFactory(trackSelectorFactory: TrackSelector.Factory!): DefaultPreloadManager.Builder!

Sets the TrackSelector.Factory that will be used by the built and ExoPlayer.

The default is a TrackSelector.Factory that always creates a new .

Parameters
trackSelectorFactory: TrackSelector.Factory!

A TrackSelector.Factory.

Returns
DefaultPreloadManager.Builder!

This builder.

Throws
java.lang.IllegalStateException

If build, buildExoPlayer or buildExoPlayer has already been called.