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!
@CanIgnoreReturnValue
setEnforceAdPlaybackOnTimelineRefresh(
    enforceAdPlaybackOnTimelineRefresh: Boolean
)

See setEnforceAdPlaybackOnTimelineRefresh 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!

See setStuckPlayingDetectionTimeoutMs for details.

TestExoPlayerBuilder!
@CanIgnoreReturnValue
setStuckSuppressedDetectionTimeoutMs(
    stuckSuppressedDetectionTimeoutMs: Int
)

See setStuckSuppressedDetectionTimeoutMs for details.

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.

setEnforceAdPlaybackOnTimelineRefresh

@CanIgnoreReturnValue
fun setEnforceAdPlaybackOnTimelineRefresh(
    enforceAdPlaybackOnTimelineRefresh: Boolean
): TestExoPlayerBuilder!

See setEnforceAdPlaybackOnTimelineRefresh for details.

Parameters
enforceAdPlaybackOnTimelineRefresh: Boolean

Whether to enforce ad playback on timeline refresh.

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.

setStuckPlayingDetectionTimeoutMs

@CanIgnoreReturnValue
fun setStuckPlayingDetectionTimeoutMs(stuckPlayingDetectionTimeoutMs: Int): TestExoPlayerBuilder!

See setStuckPlayingDetectionTimeoutMs for details.

Parameters
stuckPlayingDetectionTimeoutMs: Int

The timeout after which the player is assumed stuck playing, in milliseconds.

Returns
TestExoPlayerBuilder!

This builder.

setStuckSuppressedDetectionTimeoutMs

@CanIgnoreReturnValue
fun setStuckSuppressedDetectionTimeoutMs(
    stuckSuppressedDetectionTimeoutMs: Int
): TestExoPlayerBuilder!

See setStuckSuppressedDetectionTimeoutMs for details.

Parameters
stuckSuppressedDetectionTimeoutMs: Int

The timeout after which the player is assumed stuck in a suppressed state, in milliseconds.

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 bandwidthMeter: BandwidthMeter!

clock

var clock: Clock!

loadControl

var loadControl: LoadControl!

mediaSourceFactory

var mediaSourceFactory: MediaSource.Factory?

playbackLooper

var playbackLooper: Looper?

renderers

val renderers: Array<Renderer!>?

renderersFactory

var renderersFactory: RenderersFactory?

seekBackIncrementMs

var seekBackIncrementMs: Long

seekForwardIncrementMs

var seekForwardIncrementMs: Long

trackSelector

var trackSelector: DefaultTrackSelector!

useLazyPreparation

var useLazyPreparation: Boolean