public abstract class

SubtitleController.Renderer

extends java.lang.Object

 java.lang.Object

↳androidx.media2.player.subtitle.SubtitleController.Renderer

Subclasses:

ClosedCaptionRenderer, Cea708CaptionRenderer

Overview

Interface for supporting a single or multiple subtitle types in MediaPlayer.

Summary

Constructors
publicRenderer()

Methods
public abstract SubtitleTrackcreateTrack(MediaFormat format)

Called by MediaPlayer's SubtitleController for each subtitle track that was detected and is supported by this object to create a SubtitleTrack object.

public abstract booleansupports(MediaFormat format)

Called by MediaPlayer's SubtitleController when a new subtitle track is detected, to see if it should use this object to parse and display this subtitle track.

from java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructors

public Renderer()

Methods

public abstract boolean supports(MediaFormat format)

Called by MediaPlayer's SubtitleController when a new subtitle track is detected, to see if it should use this object to parse and display this subtitle track.

Parameters:

format: the format of the track that will include at least the MIME type .

Returns:

true if and only if the track format is supported by this renderer

public abstract SubtitleTrack createTrack(MediaFormat format)

Called by MediaPlayer's SubtitleController for each subtitle track that was detected and is supported by this object to create a SubtitleTrack object. This object will be created for each track that was found. If the track is selected for display, this object will be used to parse and display the track data.

Parameters:

format: the format of the track that will include at least the MIME type .

Returns:

a SubtitleTrack object that will be used to parse and render the subtitle track.