Back to Exoplayer

MediaSessionConnector.CaptionCallback (ExoPlayer library)

docs/doc/reference/com/google/android/exoplayer2/ext/mediasession/MediaSessionConnector.CaptionCallback.html

latest1.9 KB
Original Source

Package com.google.android.exoplayer2.ext.mediasession

Interface MediaSessionConnector.CaptionCallback


public static interfaceMediaSessionConnector.CaptionCallbackextends[MediaSessionConnector.CommandReceiver](MediaSessionConnector.CommandReceiver.html "interface in com.google.android.exoplayer2.ext.mediasession")

Handles requests for enabling or disabling captions.

Method Summary

All Methods Instance Methods Abstract Methods | Modifier and Type | Method | Description | | --- | --- | --- | | boolean | hasCaptions​(Player player) | Returns whether the media currently being played has captions. | | void | onSetCaptioningEnabled​(Player player, boolean enabled) | See MediaSessionCompat.Callback.onSetCaptioningEnabled(boolean). |

- 

Methods inherited from interface com.google.android.exoplayer2.ext.mediasession.MediaSessionConnector.CommandReceiver

onCommand

Method Detail

- 

onSetCaptioningEnabled

void onSetCaptioningEnabled​([Player](../../Player.html "interface in com.google.android.exoplayer2")player,
                            boolean enabled)

See MediaSessionCompat.Callback.onSetCaptioningEnabled(boolean).

- 

hasCaptions

boolean hasCaptions​([Player](../../Player.html "interface in com.google.android.exoplayer2")player)

Returns whether the media currently being played has captions.

This method is called each time the media session playback state needs to be updated and published upon a player state change.