SilenceMediaSource.Factory


class SilenceMediaSource.Factory


Factory for SilenceMediaSources.

Summary

Public constructors

Public functions

SilenceMediaSource!

Creates a new SilenceMediaSource.

SilenceMediaSource.Factory!
@CanIgnoreReturnValue
setDurationUs(durationUs: @IntRange(from = 1) Long)

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

Factory()

Public functions

createMediaSource

fun createMediaSource(): SilenceMediaSource!

Creates a new SilenceMediaSource.

Throws
java.lang.IllegalStateException

if the duration is a non-positive value.

setDurationUs

@CanIgnoreReturnValue
fun setDurationUs(durationUs: @IntRange(from = 1) Long): SilenceMediaSource.Factory!

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

Parameters
durationUs: @IntRange(from = 1) Long

The duration of silent audio to output, in microseconds.

Returns
SilenceMediaSource.Factory!

This factory, for convenience.

setTag

@CanIgnoreReturnValue
fun setTag(tag: Any?): SilenceMediaSource.Factory!

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

Parameters
tag: Any?

A tag for the media source.

Returns
SilenceMediaSource.Factory!

This factory, for convenience.