FakeMediaSource.Builder


class FakeMediaSource.Builder


A builder for FakeMediaSource instances.

Summary

Public constructors

Public functions

FakeMediaSource!

Creates a FakeMediaSource from this builder.

FakeMediaSource.Builder!

Sets the DrmSessionManager.

FakeMediaSource.Builder!

Sets the track formats to use for the TrackGroupArray when creating instances.

FakeMediaSource.Builder!

Sets the timestamps of 'sync samples' in the samples returned from setTrackDataFactory.

FakeMediaSource.Builder!

Sets the Timeline.

FakeMediaSource.Builder!

Sets the factory used to generate track data.

FakeMediaSource.Builder!

Sets the the TrackGroupArray used when creating FakeMediaPeriod instances.

Public constructors

Builder

Builder()

Public functions

build

fun build(): FakeMediaSource!

Creates a FakeMediaSource from this builder.

setDrmSessionManager

@CanIgnoreReturnValue
fun setDrmSessionManager(drmSessionManager: DrmSessionManager!): FakeMediaSource.Builder!

Sets the DrmSessionManager. Defaults to DRM_UNSUPPORTED.

setFormats

@CanIgnoreReturnValue
fun setFormats(format: Format!, formats: Array<Format!>!): FakeMediaSource.Builder!

Sets the track formats to use for the TrackGroupArray when creating instances.

Setting this overrides any previous call to setTrackGroupArray.

Defaults to an empty list (i.e. no tracks).

setSyncSampleTimesUs

@CanIgnoreReturnValue
fun setSyncSampleTimesUs(syncSampleTimesUs: LongArray!): FakeMediaSource.Builder!

Sets the timestamps of 'sync samples' in the samples returned from setTrackDataFactory.

setTimeline

@CanIgnoreReturnValue
fun setTimeline(timeline: Timeline!): FakeMediaSource.Builder!

Sets the Timeline. Defaults to null (in which case it can be set later with setNewSourceInfo).

See getTimeline.

setTrackDataFactory

@CanIgnoreReturnValue
fun setTrackDataFactory(trackDataFactory: FakeMediaPeriod.TrackDataFactory!): FakeMediaSource.Builder!

Sets the factory used to generate track data. Defaults to singleSampleWithTimeUs based on the first timestamp of a period.

setTrackGroupArray

@CanIgnoreReturnValue
fun setTrackGroupArray(trackGroupArray: TrackGroupArray!): FakeMediaSource.Builder!

Sets the the TrackGroupArray used when creating FakeMediaPeriod instances.

Setting this overrides any previous call to setFormats.

Defaults to an empty array (i.e. no tracks).