CallbackMediaItem.Builder

Added in 1.0.0
Deprecated in 1.3.0

public final class CallbackMediaItem.Builder extends MediaItem.Builder


This Builder class simplifies the creation of a CallbackMediaItem object.

Summary

Public constructors

Creates a new Builder object.

Public methods

@NonNull CallbackMediaItem
@NonNull CallbackMediaItem.Builder
setEndPosition(long position)

Sets the end position in milliseconds at which the playback will end.

@NonNull CallbackMediaItem.Builder

Set the metadata of this instance.

@NonNull CallbackMediaItem.Builder
setStartPosition(long position)

Sets the start position in milliseconds at which the playback will start.

Public constructors

Builder

Added in 1.0.0
Deprecated in 1.3.0
public Builder(@NonNull DataSourceCallback dsc2)

Creates a new Builder object.

Parameters
@NonNull DataSourceCallback dsc2

the DataSourceCallback for the media you want to play

Public methods

build

Added in 1.3.0
Deprecated in 1.3.0
public @NonNull CallbackMediaItem build()
Returns
@NonNull CallbackMediaItem

A new CallbackMediaItem with values supplied by the Builder.

setEndPosition

Added in 1.3.0
Deprecated in 1.3.0
public @NonNull CallbackMediaItem.Builder setEndPosition(long position)

Sets the end position in milliseconds at which the playback will end. Any negative number is treated as maximum length of the media item.

Parameters
long position

the end position in milliseconds at which the playback will end

Returns
@NonNull CallbackMediaItem.Builder

this instance for chaining

setMetadata

Added in 1.3.0
Deprecated in 1.3.0
public @NonNull CallbackMediaItem.Builder setMetadata(@Nullable MediaMetadata metadata)

Set the metadata of this instance. null for unset.

Parameters
@Nullable MediaMetadata metadata

metadata

Returns
@NonNull CallbackMediaItem.Builder

this instance for chaining

setStartPosition

Added in 1.3.0
Deprecated in 1.3.0
public @NonNull CallbackMediaItem.Builder setStartPosition(long position)

Sets the start position in milliseconds at which the playback will start. Any negative number is treated as 0.

Parameters
long position

the start position in milliseconds at which the playback will start

Returns
@NonNull CallbackMediaItem.Builder

this instance for chaining