MediaItemBuilder
Builds a MediaItem one setting at a time. Each call has the name of the field it sets, every call is optional, and each returns this builder.
Kotlin builds an item in the block of mediaItem. Java cannot call the MediaItem constructor, because a parameter of the type Duration hides it, so it makes a builder, chains its calls and ends with build (#394):
MediaItem item = new MediaItemBuilder("https://example.com/movie.mp4")
.title("Movie")
.startPositionMillis(90_000)
.build();Functions
See MediaItem.album.
See MediaItem.artist.
See MediaItem.clip. A null end runs to the end of the file.
MediaItem.clip in milliseconds, for Java, which cannot make a Duration. A null endMillis runs to the end of the file.
Replaces the whole of MediaItem.demux. probe, corruptPackets, generateTimestamps, lowLatency and skipInitialBytes change one field of it each.
Adds a subtitle file. See SubtitleSource.
Adds subtitle files. See SubtitleSource.
See MediaItem.formatHint. Null leaves the format to the probe.
Adds one request header. See MediaItem.headers.
Adds request headers. See MediaItem.headers.
See MediaItem.io.
Adds one raw demuxer option. See MediaItem.openOptions.
See DemuxPolicy.probe.
MediaItem.startPosition in milliseconds, for Java, which cannot make a Duration.
A WebVTT thumbnail file for a seek bar's preview. See MediaItem.thumbnails.
See MediaItem.title.