TestExoPlayerBuilder


@UnstableApi
class TestExoPlayerBuilder


A builder of ExoPlayer instances for testing.

Summary

Public constructors

Public functions

ExoPlayer!

Builds an ExoPlayer using the provided values or their defaults.

Long

Returns the max seek to previous position used by the player.

TestExoPlayerBuilder!

Sets the variable controlling player's ability to get/set device volume.

TestExoPlayerBuilder!

See experimentalSetDynamicSchedulingEnabled for details.

TestExoPlayerBuilder!

Sets the max seek to previous position, in milliseconds, to be used by the player.

TestExoPlayerBuilder!

Sets the preload configuration.

TestExoPlayerBuilder!

Sets the Renderers.

TestExoPlayerBuilder!

Sets the SuitableOutputChecker to check the suitability of the selected outputs for playback.

TestExoPlayerBuilder!
@CanIgnoreReturnValue
setSuppressPlaybackOnUnsuitableOutput(
    suppressPlaybackOnUnsuitableOutput: Boolean
)

See setSuppressPlaybackOnUnsuitableOutput for details.

Public constructors

TestExoPlayerBuilder

TestExoPlayerBuilder(context: Context!)

Public functions

build

fun build(): ExoPlayer!

Builds an ExoPlayer using the provided values or their defaults.

getMaxSeekToPreviousPosition

fun getMaxSeekToPreviousPosition(): Long

Returns the max seek to previous position used by the player.

setDeviceVolumeControlEnabled

@CanIgnoreReturnValue
fun setDeviceVolumeControlEnabled(deviceVolumeControlEnabled: Boolean): TestExoPlayerBuilder!

Sets the variable controlling player's ability to get/set device volume.

Parameters
deviceVolumeControlEnabled: Boolean

Whether the player can get/set device volume.

Returns
TestExoPlayerBuilder!

This builder.

setDynamicSchedulingEnabled

@CanIgnoreReturnValue
fun setDynamicSchedulingEnabled(dynamicSchedulingEnabled: Boolean): TestExoPlayerBuilder!

See experimentalSetDynamicSchedulingEnabled for details.

Parameters
dynamicSchedulingEnabled: Boolean

Whether the player should enable dynamically schedule its playback loop for when Renderer progress can be made.

Returns
TestExoPlayerBuilder!

This builder.

setMaxSeekToPreviousPositionMs

@CanIgnoreReturnValue
fun setMaxSeekToPreviousPositionMs(maxSeekToPreviousPositionMs: Long): TestExoPlayerBuilder!

Sets the max seek to previous position, in milliseconds, to be used by the player.

Parameters
maxSeekToPreviousPositionMs: Long

The max seek to previous position to be used by the player.

Returns
TestExoPlayerBuilder!

This builder.

setPreloadConfiguration

@CanIgnoreReturnValue
fun setPreloadConfiguration(
    preloadConfiguration: ExoPlayer.PreloadConfiguration!
): TestExoPlayerBuilder!

Sets the preload configuration.

setRenderers

@CanIgnoreReturnValue
fun setRenderers(renderers: Array<Renderer!>!): TestExoPlayerBuilder!

Sets the Renderers. If not set, the player will use a FakeVideoRenderer and a FakeAudioRenderer. Setting the renderers is not allowed after a call to setRenderersFactory.

Parameters
renderers: Array<Renderer!>!

A list of Renderers to be used by the player.

Returns
TestExoPlayerBuilder!

This builder.

setSuitableOutputChecker

@CanIgnoreReturnValue
@RequiresApi(value = 35)
fun setSuitableOutputChecker(suitableOutputChecker: SuitableOutputChecker!): TestExoPlayerBuilder!

Sets the SuitableOutputChecker to check the suitability of the selected outputs for playback.

If this method is not called, the library uses a default implementation based on framework APIs.

Returns
TestExoPlayerBuilder!

This builder.

setSuppressPlaybackOnUnsuitableOutput

@CanIgnoreReturnValue
fun setSuppressPlaybackOnUnsuitableOutput(
    suppressPlaybackOnUnsuitableOutput: Boolean
): TestExoPlayerBuilder!

See setSuppressPlaybackOnUnsuitableOutput for details.

Parameters
suppressPlaybackOnUnsuitableOutput: Boolean

Whether the player should suppress the playback when it is attempted on an unsuitable output.

Returns
TestExoPlayerBuilder!

This builder.

Public properties

bandwidthMeter

var bandwidthMeterBandwidthMeter!

clock

var clockClock!

loadControl

var loadControlLoadControl!

mediaSourceFactory

var mediaSourceFactoryMediaSource.Factory?

renderers

val renderersArray<Renderer!>?

renderersFactory

var renderersFactoryRenderersFactory?

seekBackIncrementMs

var seekBackIncrementMsLong

seekForwardIncrementMs

var seekForwardIncrementMsLong

trackSelector

var trackSelectorDefaultTrackSelector!

useLazyPreparation

var useLazyPreparationBoolean