FakeMediaSource.Builder


public class FakeMediaSource.Builder


A builder for FakeMediaSource instances.

Summary

Public constructors

Public methods

FakeMediaSource

Creates a FakeMediaSource from this builder.

FakeMediaSource.Builder

Sets the DrmSessionManager.

FakeMediaSource.Builder
@CanIgnoreReturnValue
setFormats(Format format, Format[] formats)

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

FakeMediaSource.Builder
@CanIgnoreReturnValue
setSyncSampleTimesUs(long[] syncSampleTimesUs)

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

public Builder()

Public methods

build

public FakeMediaSource build()

Creates a FakeMediaSource from this builder.

setDrmSessionManager

@CanIgnoreReturnValue
public FakeMediaSource.Builder setDrmSessionManager(DrmSessionManager drmSessionManager)

Sets the DrmSessionManager. Defaults to DRM_UNSUPPORTED.

setFormats

@CanIgnoreReturnValue
public FakeMediaSource.Builder setFormats(Format format, Format[] formats)

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
public FakeMediaSource.Builder setSyncSampleTimesUs(long[] syncSampleTimesUs)

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

setTimeline

@CanIgnoreReturnValue
public FakeMediaSource.Builder setTimeline(Timeline timeline)

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

See getTimeline.

setTrackDataFactory

@CanIgnoreReturnValue
public FakeMediaSource.Builder setTrackDataFactory(FakeMediaPeriod.TrackDataFactory trackDataFactory)

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

setTrackGroupArray

@CanIgnoreReturnValue
public FakeMediaSource.Builder setTrackGroupArray(TrackGroupArray trackGroupArray)

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).