TextOverlay
@UnstableApi
abstract class TextOverlay : BitmapOverlay
| kotlin.Any | |||
| ↳ | androidx.media3.effect.TextureOverlay | ||
| ↳ | androidx.media3.effect.BitmapOverlay | ||
| ↳ | androidx.media3.effect.TextOverlay |
Creates a TextureOverlay from text.
Uses a SpannableString to store the text and support advanced per-character text styling.
Summary
Constants |
|
|---|---|
const Int |
TEXT_SIZE_PIXELS = 100 |
Public constructors |
|---|
Public functions |
|
|---|---|
java-static TextOverlay! |
createStaticTextOverlay(overlayText: SpannableString!)Creates a |
java-static TextOverlay! |
createStaticTextOverlay(Creates a |
Bitmap! |
Returns the overlay bitmap displayed at the specified timestamp. |
abstract SpannableString! |
Returns the overlay text displayed at the specified timestamp. |
Inherited functions |
||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
||||||||||||||
|
Constants
Public constructors
Public functions
createStaticTextOverlay
java-static fun createStaticTextOverlay(overlayText: SpannableString!): TextOverlay!
Creates a TextOverlay that shows the overlayText with the same default settings in StaticOverlaySettings throughout the whole video.
createStaticTextOverlay
java-static fun createStaticTextOverlay(
overlayText: SpannableString!,
overlaySettings: StaticOverlaySettings!
): TextOverlay!
Creates a TextOverlay that shows the overlayText with the same StaticOverlaySettings throughout the whole video.
| Parameters | |
|---|---|
overlayText: SpannableString! |
The text to overlay on the video. |
overlaySettings: StaticOverlaySettings! |
The |
getBitmap
fun getBitmap(presentationTimeUs: Long): Bitmap!
Returns the overlay bitmap displayed at the specified timestamp.
| Parameters | |
|---|---|
presentationTimeUs: Long |
The presentation timestamp of the current frame, in microseconds. |
| Throws | |
|---|---|
androidx.media3.common.VideoFrameProcessingException |
If an error occurs while processing or drawing the frame. |
getText
abstract fun getText(presentationTimeUs: Long): SpannableString!
Returns the overlay text displayed at the specified timestamp.
| Parameters | |
|---|---|
presentationTimeUs: Long |
The presentation timestamp of the current frame, in microseconds. |