docs/doc/reference/com/google/android/exoplayer2/source/SilenceMediaSource.Factory.html
Package com.google.android.exoplayer2.source
Enclosing class:SilenceMediaSource
public static final classSilenceMediaSource.Factoryextends[Object](https://developer.android.com/reference/java/lang/Object.html "class or interface in java.lang")
Factory for SilenceMediaSources.
Constructors | Constructor | Description |
| --- | --- |
| Factory() | |
All Methods Instance Methods Concrete Methods | Modifier and Type | Method | Description |
| --- | --- | --- |
| SilenceMediaSource | createMediaSource() |
Creates a new SilenceMediaSource.
|
| SilenceMediaSource.Factory | setDurationUs(long durationUs) |
Sets the duration of the silent audio.
|
| SilenceMediaSource.Factory | setTag(Object tag) |
Sets a tag for the media source which will be published in the Timeline of the source as Window#mediaItem.localConfiguration.tag.
|
-
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
public Factory()
-
@CanIgnoreReturnValue
public[SilenceMediaSource.Factory](SilenceMediaSource.Factory.html "class in com.google.android.exoplayer2.source")setDurationUs(@IntRange(from=1L)
long durationUs)
Sets the duration of the silent audio. The value needs to be a positive value.
Parameters:durationUs - The duration of silent audio to output, in microseconds.Returns:This factory, for convenience.
-
@CanIgnoreReturnValue
public[SilenceMediaSource.Factory](SilenceMediaSource.Factory.html "class in com.google.android.exoplayer2.source")setTag(@Nullable[Object](https://developer.android.com/reference/java/lang/Object.html "class or interface in java.lang")tag)
Sets a tag for the media source which will be published in the Timeline of the source as Window#mediaItem.localConfiguration.tag.
Parameters:tag - A tag for the media source.Returns:This factory, for convenience.
-
public[SilenceMediaSource](SilenceMediaSource.html "class in com.google.android.exoplayer2.source")createMediaSource()
Creates a new SilenceMediaSource.
Throws:IllegalStateException - if the duration is a non-positive value.