Added in API level 28

OnSubtitleDataListener


interface OnSubtitleDataListener
android.media.MediaPlayer.OnSubtitleDataListener

Interface definition of a callback to be invoked when a player subtitle track has new subtitle data available. See the MediaPlayer#setOnSubtitleDataListener(OnSubtitleDataListener, Handler) method for the description of which track will report data through this listener.

Summary

Public methods
abstract Unit

Method called when new subtitle data is available

Public methods

onSubtitleData

Added in API level 28
abstract fun onSubtitleData(
    mp: MediaPlayer,
    data: SubtitleData
): Unit

Method called when new subtitle data is available

Parameters
mp MediaPlayer: the player that reports the new subtitle data This value cannot be null.
data SubtitleData: the subtitle data This value cannot be null.