Back to Exoplayer

SilenceMediaSource.Factory (ExoPlayer library)

docs/doc/reference/com/google/android/exoplayer2/source/SilenceMediaSource.Factory.html

latest3.3 KB
Original Source

Package com.google.android.exoplayer2.source

Class SilenceMediaSource.Factory


public static final classSilenceMediaSource.Factoryextends[Object](https://developer.android.com/reference/java/lang/Object.html "class or interface in java.lang")

Factory for SilenceMediaSources.

Constructor Summary

Constructors | Constructor | Description | | --- | --- | | Factory() | |

Method Summary

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

- 

Methods inherited from class java.lang.Object

clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

- 

Factory

public Factory()

Method Detail

- 

setDurationUs

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

- 

setTag

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

- 

createMediaSource

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.