DefaultSubtitleParserFactory


@UnstableApi
public final class DefaultSubtitleParserFactory implements SubtitleParser.Factory


A factory for SubtitleParser instances.

The formats supported by this factory are:

Summary

Public constructors

Public methods

SubtitleParser
create(Format format)

Creates a SubtitleParser for the given Format.

int

Returns the CueReplacementBehavior of the SubtitleParser implementation that handles format.

boolean

Returns whether the factory is able to instantiate a SubtitleParser for the given Format.

Inherited Constants

From androidx.media3.extractor.text.SubtitleParser.Factory
static final SubtitleParser.Factory

A subtitle parser factory that supports no formats.

Public constructors

DefaultSubtitleParserFactory

public DefaultSubtitleParserFactory()

Public methods

create

public SubtitleParser create(Format format)

Creates a SubtitleParser for the given Format.

Returns
SubtitleParser

The SubtitleParser instance.

Throws
java.lang.IllegalArgumentException

if format is not supported by this factory.

getCueReplacementBehavior

@Format.CueReplacementBehavior
public int getCueReplacementBehavior(Format format)

Returns the CueReplacementBehavior of the SubtitleParser implementation that handles format.

Returns
int

The replacement behavior.

Throws
java.lang.IllegalArgumentException

if format is not supported by this factory.

supportsFormat

public boolean supportsFormat(Format format)

Returns whether the factory is able to instantiate a SubtitleParser for the given Format.

Parameters
Format format

The Format.

Returns
boolean

Whether the factory can instantiate a suitable SubtitleParser.