RemoteCastPlayer.Builder


@UnstableApi
public final class RemoteCastPlayer.Builder


A builder for RemoteCastPlayer instances.

See Builder for the list of default values.

Summary

Public constructors

Builder(Context context)

Creates a builder.

Public methods

RemoteCastPlayer

Builds and returns a RemoteCastPlayer instance.

RemoteCastPlayer.Builder
@CanIgnoreReturnValue
setMaxSeekToPreviousPositionMs(
    @IntRange(from = 0) long maxSeekToPreviousPositionMs
)

Sets the maximum position for which seekToPrevious seeks to the previous MediaItem.

RemoteCastPlayer.Builder

Sets the MediaItemConverter that will be used by the player to convert MediaItems.

RemoteCastPlayer.Builder
@CanIgnoreReturnValue
setSeekBackIncrementMs(@IntRange(from = 1) long seekBackIncrementMs)

Sets the seekBack increment.

RemoteCastPlayer.Builder
@CanIgnoreReturnValue
setSeekForwardIncrementMs(@IntRange(from = 1) long seekForwardIncrementMs)

Sets the seekForward increment.

Public methods

build

public RemoteCastPlayer build()

Builds and returns a RemoteCastPlayer instance.

Throws
java.lang.IllegalStateException

If this method has already been called.

setMaxSeekToPreviousPositionMs

@CanIgnoreReturnValue
public RemoteCastPlayer.Builder setMaxSeekToPreviousPositionMs(
    @IntRange(from = 0) long maxSeekToPreviousPositionMs
)

Sets the maximum position for which seekToPrevious seeks to the previous MediaItem.

Parameters
@IntRange(from = 0) long maxSeekToPreviousPositionMs

The maximum position, in milliseconds.

Returns
RemoteCastPlayer.Builder

This builder.

Throws
java.lang.IllegalArgumentException

If maxSeekToPreviousPositionMs is negative.

java.lang.IllegalStateException

If build has already been called.

setMediaItemConverter

@CanIgnoreReturnValue
public RemoteCastPlayer.Builder setMediaItemConverter(MediaItemConverter mediaItemConverter)

Sets the MediaItemConverter that will be used by the player to convert MediaItems.

Parameters
MediaItemConverter mediaItemConverter

A MediaItemConverter.

Returns
RemoteCastPlayer.Builder

This builder.

Throws
java.lang.IllegalStateException

If build has already been called.

setSeekBackIncrementMs

@CanIgnoreReturnValue
public RemoteCastPlayer.Builder setSeekBackIncrementMs(@IntRange(from = 1) long seekBackIncrementMs)

Sets the seekBack increment.

Parameters
@IntRange(from = 1) long seekBackIncrementMs

The seek back increment, in milliseconds.

Returns
RemoteCastPlayer.Builder

This builder.

Throws
java.lang.IllegalArgumentException

If seekBackIncrementMs is non-positive.

java.lang.IllegalStateException

If build has already been called.

setSeekForwardIncrementMs

@CanIgnoreReturnValue
public RemoteCastPlayer.Builder setSeekForwardIncrementMs(@IntRange(from = 1) long seekForwardIncrementMs)

Sets the seekForward increment.

Parameters
@IntRange(from = 1) long seekForwardIncrementMs

The seek forward increment, in milliseconds.

Returns
RemoteCastPlayer.Builder

This builder.

Throws
java.lang.IllegalArgumentException

If seekForwardIncrementMs is non-positive.

java.lang.IllegalStateException

If build has already been called.