Builder
open class Builder
kotlin.Any | |
↳ | androidx.media2.common.MediaItem.Builder |
Builder for MediaItem
.
Summary
Public constructors | |
---|---|
<init>() Default constructor |
Public methods | |
---|---|
open MediaItem |
build() Build |
open MediaItem.Builder |
setEndPosition(position: Long) Sets the end position in milliseconds at which the playback will end. |
open MediaItem.Builder |
setMetadata(@Nullable metadata: MediaMetadata?) Set the metadata of this instance. |
open MediaItem.Builder |
setStartPosition(position: Long) Sets the start position in milliseconds at which the playback will start. |
Public constructors
<init>
Builder()
Default constructor
Public methods
setEndPosition
@NonNull open fun setEndPosition(position: Long): MediaItem.Builder
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 | |
---|---|
position |
Long: the end position in milliseconds at which the playback will end |
Return | |
---|---|
MediaItem.Builder |
this instance for chaining |
setMetadata
@NonNull open fun setMetadata(@Nullable metadata: MediaMetadata?): MediaItem.Builder
Set the metadata of this instance. null
for unset.
Parameters | |
---|---|
metadata |
MediaMetadata?: metadata |
Return | |
---|---|
MediaItem.Builder |
this instance for chaining |
setStartPosition
@NonNull open fun setStartPosition(position: Long): MediaItem.Builder
Sets the start position in milliseconds at which the playback will start. Any negative number is treated as 0.
Parameters | |
---|---|
position |
Long: the start position in milliseconds at which the playback will start |
Return | |
---|---|
MediaItem.Builder |
this instance for chaining |