public interface

SubtitleParser.Factory

 androidx.media3.extractor.text.SubtitleParser.Factory

Subclasses:

DefaultSubtitleParserFactory

Overview

Factory for SubtitleParser instances.

Summary

Fields
public static final SubtitleParser.FactoryUNSUPPORTED

A subtitle parser factory that supports no formats.

Methods
public SubtitleParsercreate(Format format)

Creates a SubtitleParser for the given Format.

public intgetCueReplacementBehavior(Format format)

Returns the Format.CueReplacementBehavior of the SubtitleParser implementation that handles format.

public booleansupportsFormat(Format format)

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

Fields

public static final SubtitleParser.Factory UNSUPPORTED

A subtitle parser factory that supports no formats.

Methods

public boolean supportsFormat(Format format)

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

Parameters:

format: The Format.

Returns:

Whether the factory can instantiate a suitable SubtitleParser.

public int getCueReplacementBehavior(Format format)

Returns the Format.CueReplacementBehavior of the SubtitleParser implementation that handles format.

Returns:

The replacement behavior.

public SubtitleParser create(Format format)

Creates a SubtitleParser for the given Format.

Returns:

The SubtitleParser instance.