public class

MediaItem.BuilderBase<T extends MediaItem.BuilderBase>

extends java.lang.Object

 java.lang.Object

↳androidx.media2.MediaItem.BuilderBase<T>

Subclasses:

CallbackMediaItem.Builder, UriMediaItem.Builder, FileMediaItem.Builder, MediaItem.Builder

Overview

Base builder for MediaItem and its subclass.

Summary

Constructors
publicBuilderBase()

Methods
public MediaItembuild()

Build MediaItem.

public MediaItem.BuilderBase<T>setEndPosition(long position)

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

public MediaItem.BuilderBase<T>setMetadata(MediaMetadata metadata)

Set the metadata of this instance.

public MediaItem.BuilderBase<T>setStartPosition(long position)

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

from java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructors

public BuilderBase()

Methods

public MediaItem.BuilderBase<T> setMetadata(MediaMetadata metadata)

Set the metadata of this instance. null for unset.

Parameters:

metadata: metadata

Returns:

this instance for chaining

public MediaItem.BuilderBase<T> setStartPosition(long position)

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

Parameters:

position: the start position in milliseconds at which the playback will start

Returns:

the same Builder instance.

public MediaItem.BuilderBase<T> 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:

position: the end position in milliseconds at which the playback will end

Returns:

the same Builder instance.

public MediaItem build()

Build MediaItem.

Returns:

a new MediaItem.