Back to Exoplayer

TextOverlay (ExoPlayer library)

docs/doc/reference/com/google/android/exoplayer2/effect/TextOverlay.html

latest6.4 KB
Original Source

Package com.google.android.exoplayer2.effect

Class TextOverlay


[@Deprecated](https://developer.android.com/reference/java/lang/Deprecated.html "class or interface in java.lang")public abstract classTextOverlayextends[BitmapOverlay](BitmapOverlay.html "class in com.google.android.exoplayer2.effect")

Deprecated. com.google.android.exoplayer2 is deprecated. Please migrate to androidx.media3 (which contains the same ExoPlayer code). See the migration guide for more details, including a script to help with the migration.

Creates a TextureOverlay from text.

Uses a SpannableString to store the text and support advanced per-character text styling.

Field Summary

Fields | Modifier and Type | Field | Description | | --- | --- | --- | | static int | TEXT_SIZE_PIXELS | Deprecated. |

Constructor Summary

Constructors | Constructor | Description | | --- | --- | | TextOverlay() | Deprecated. |

Method Summary

All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Deprecated Methods | Modifier and Type | Method | Description | | --- | --- | --- | | static TextOverlay | createStaticTextOverlay​(SpannableString overlayText) | Deprecated.

Creates a TextOverlay that shows the overlayText with the same default settings in OverlaySettings throughout the whole video. | | static TextOverlay | createStaticTextOverlay​(SpannableString overlayText, OverlaySettings overlaySettings) | Deprecated.

Creates a TextOverlay that shows the overlayText with the same OverlaySettings throughout the whole video. | | Bitmap | getBitmap​(long presentationTimeUs) | Deprecated.

Returns the overlay bitmap displayed at the specified timestamp. | | abstract SpannableString | getText​(long presentationTimeUs) | Deprecated.

Returns the overlay text displayed at the specified timestamp. |

- 

Methods inherited from class com.google.android.exoplayer2.effect.BitmapOverlay

createStaticBitmapOverlay, createStaticBitmapOverlay, createStaticBitmapOverlay, getTextureId, getTextureSize

- 

Methods inherited from class com.google.android.exoplayer2.effect.TextureOverlay

configure, getOverlaySettings

- 

Methods inherited from class java.lang.Object

clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

- 

TEXT_SIZE_PIXELS

public static final int TEXT_SIZE_PIXELS

Deprecated. See Also:Constant Field Values

Constructor Detail

- 

TextOverlay

public TextOverlay()

Deprecated.

Method Detail

- 

createStaticTextOverlay

public static[TextOverlay](TextOverlay.html "class in com.google.android.exoplayer2.effect")createStaticTextOverlay​([SpannableString](https://developer.android.com/reference/android/text/SpannableString.html "class or interface in android.text")overlayText)

Deprecated.

Creates a TextOverlay that shows the overlayText with the same default settings in OverlaySettings throughout the whole video.

- 

createStaticTextOverlay

public static[TextOverlay](TextOverlay.html "class in com.google.android.exoplayer2.effect")createStaticTextOverlay​([SpannableString](https://developer.android.com/reference/android/text/SpannableString.html "class or interface in android.text")overlayText,[OverlaySettings](OverlaySettings.html "class in com.google.android.exoplayer2.effect")overlaySettings)

Deprecated.

Creates a TextOverlay that shows the overlayText with the same OverlaySettings throughout the whole video. Parameters:overlayText - The text to overlay on the video.overlaySettings - The OverlaySettings configuring how the overlay is displayed on the frames.

- 

getText

public abstract[SpannableString](https://developer.android.com/reference/android/text/SpannableString.html "class or interface in android.text")getText​(long presentationTimeUs)

Deprecated.

Returns the overlay text displayed at the specified timestamp. Parameters:presentationTimeUs - The presentation timestamp of the current frame, in microseconds.

- 

getBitmap

public[Bitmap](https://developer.android.com/reference/android/graphics/Bitmap.html "class or interface in android.graphics")getBitmap​(long presentationTimeUs)

Deprecated.

Description copied from class: BitmapOverlay

Returns the overlay bitmap displayed at the specified timestamp. Specified by:getBitmap in class BitmapOverlayParameters:presentationTimeUs - The presentation timestamp of the current frame, in microseconds.