DefaultSubtitleParserFactory


@UnstableApi
class DefaultSubtitleParserFactory : SubtitleParser.Factory


A factory for SubtitleParser instances.

The formats supported by this factory are:

Summary

Public constructors

Public functions

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
const SubtitleParser.Factory!

A subtitle parser factory that supports no formats.

Public constructors

DefaultSubtitleParserFactory

DefaultSubtitleParserFactory()

Public functions

create

fun create(format: Format!): SubtitleParser!

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
fun getCueReplacementBehavior(format: Format!): Int

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

fun supportsFormat(format: Format!): Boolean

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.