Add captions

Add embedded or sidecar captions to your Android app.

If you have captions or subtitles for your video content, you can use the following sections to add embedded or sidecar captions to your app.

Although there are differences between the intended purposes of captions and subtitles, you use the same processes to add or to customize either type of synchronized text to your app. For simplicity, both captions and subtitles are referred to as captions in our documentation.


The JW Player SDK for Android respects the Caption Styling accessibility preferences of a viewer. This enables your viewers to maintain their customizations while still enjoying the video experience you have created.

Add captions to your app

Embedded captions

To add videos or streams with embedded captions to your app, follow the steps to create a playlist. Replace step 2 of the process with the two steps below:

  1. Copy the URL of your video. The video must contain CEA-608, CEA-708, or in-manifest WebVTT captions.
  2. Define the file property of the PlaylisItem object with the URL of your video.

Sidecar captions

  1. Create a List<Caption> object and name it, for example, captionTracks.
  2. Use Caption.Builder() to create and name a Caption object for each caption track.
  3. Add the caption track URL (file) and a language label (label).
  4. (Optional) If you have multiple tracks, set isDefault(true) for the default caption track.
  5. Add each caption track to captionTracks.
  6. Add captionTracks to a playlist item.

List<Caption> captionTracks = new ArrayList<>();

Caption captionEn = new Caption.Builder()

Caption captionSp = new Caption.Builder()

PlaylistItem playlistItem = new PlaylistItem.Builder()
    .title("The Title")
    .description("The description")

List<PlaylistItem> playlist = new ArrayList<>();
PlayerConfig config = new PlayerConfig.Builder()

Captions Methods and Callbacks


List<Caption> getCaptionsList()Returns a List with captions tracks from the player
int getCurrentCaptions()Returns the index of the currently active captions track

The captions are off if the index is 0
setCurrentCaptions(int index)Change the visible captions track to the provided index

The index must be within the list provided by getCaptionsList().


onCaptionsList(CaptionsListEvent captionsListEvent)Fired when the list of available captions tracks is updated
onCaptionsChanged(CaptionsChangedEvent)Fired when the active captions track is changed

Did this page help you?