Set up closed captioning

Closed captioning allows people with hearing disabilities to have access to video programming by displaying the audio portion of the video as text on the screen.

Closed captioning differs from subtitles in that subtitles are typically not in the same language as the audio and subtitles do not typically include information about background sounds such as the sound of a door slamming or music.

Closed captions are part of the data packets of the MPEG-2 video streams inside the video transmission stream. The Android PSDK supports rendering 608 and 708 closed captioning, when delivered as part of the video transport stream over HLS. Additionally, it supports WebVTT as a sidecar caption option. You can:

  • Switch closed captioning on or off (visible or not visible)
  • Style the closed captions by selecting the font, font color, and other attributes.
Note: In the PSDK for Android, closed captions are always enabled. All default closed-caption tracks are considered to be present. Default tracks (such as CC1-CC4, CS1-CS6) are enumerated in ClosedCaptionsTrack.DefaultCCTypes . When playback begins, the PSDK looks for activity on any of these channels. If activity is found, the PSDK sets the isActive method for that track and dispatches the MediaPlayer.PlaybackEventListener.onUpdated event.
Note: Based on the HLS specifications, WebVTT files are referenced from the m3u8 manifest files, and are automatically available as CC tracks in the Primetime Player.

Beyond the simple closed-caption-related API exposed by the MediaPlayerItem interface, the MediaPlayer interface allows you to control various parameters that dictate how closed-captions data is rendered by the underlying video engine.