SilenceMediaSource.Factory
public final class SilenceMediaSource.Factory
Factory for SilenceMediaSources.
Summary
Public constructors |
|---|
Factory() |
Public methods |
|
|---|---|
SilenceMediaSource |
Creates a new |
SilenceMediaSource.Factory |
@CanIgnoreReturnValueSets the duration of the silent audio. |
SilenceMediaSource.Factory |
Sets a tag for the media source which will be published in the |
Public constructors
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.
| Returns | |
|---|---|
SilenceMediaSource.Factory |
This factory, for convenience. |