SilenceMediaSource.Factory

public final class SilenceMediaSource.Factory


Factory for SilenceMediaSources.

Summary

Public constructors

Public methods

SilenceMediaSource

Creates a new SilenceMediaSource.

SilenceMediaSource.Factory
@CanIgnoreReturnValue
setDurationUs(@IntRange(from = 1) long durationUs)

Sets the duration of the silent audio.

SilenceMediaSource.Factory

Sets a tag for the media source which will be published in the Timeline of the source as Window#mediaItem.localConfiguration.tag.

Public constructors

Factory

public Factory()

Public methods

createMediaSource

public SilenceMediaSource createMediaSource()

Creates a new SilenceMediaSource.

Throws
java.lang.IllegalStateException

if the duration is a non-positive value.

setDurationUs

@CanIgnoreReturnValue
public SilenceMediaSource.Factory setDurationUs(@IntRange(from = 1) long durationUs)

Sets the duration of the silent audio. The value needs to be a positive value.

Parameters
@IntRange(from = 1) long durationUs

The duration of silent audio to output, in microseconds.

Returns
SilenceMediaSource.Factory

This factory, for convenience.

setTag

@CanIgnoreReturnValue
public SilenceMediaSource.Factory setTag(@Nullable Object tag)

Sets a tag for the media source which will be published in the Timeline of the source as Window#mediaItem.localConfiguration.tag.

Parameters
@Nullable Object tag

A tag for the media source.

Returns
SilenceMediaSource.Factory

This factory, for convenience.