Skip to main content

Add Captions to Your Media

Captions, also known as subtitles, are an essential tool for ensuring access to information and content for diverse audiences. They provide a text-based representation of spoken words or audio in videos, films, TV shows, and other multimedia content. Captions serve multiple purposes, including making content accessible for individuals with hearing loss or deafness, those who speak a different language, or those in noisy environments where audio is difficult to hear. Captions also benefit individuals with cognitive or learning disabilities, as they can help with comprehension and retention of information. Additionally, captions can enhance the overall viewing experience by providing additional context, clarifying dialogue, and improving comprehension for all viewers. In educational settings, captions can assist in language learning, literacy development, and facilitate better understanding of complex subject matter. Overall, captions are crucial in promoting inclusivity, accessibility, and equal access to information and entertainment for a wide range of individuals, making them an indispensable tool in modern media.

LuraPlayer supports embedded and sidecar captions.

Embedded Captions

LuraPlayer detects the embedded captions in CEA-608, CEA-708 or in-manifest WebVTT formats. No additional configuration is needed.

Sidecar Captions

Sidecar captions refer to a specific type of closed captioning format where the caption data is stored separately from the multimedia content.

To configure the caption sources of the video in Lura Player, you can use the following configuration.

AttributeTypeRequiredDescription
urlStringyesURL of the caption that will be loaded
typeStringyesMIME type of the caption
languageStringyesLanguage of the caption in ISO 639-1 format

Here are the supported MIME types:

  • text/vtt - Web Video Text Tracks Format (WebVTT)
  • text/plain - SubRip Text (SRT)
  • application/ttml+xml - Timed Text Markup Language (TTML)
  • application/ttaf+xml - Distribution Format Exchange Profile (DFXP)
  • application/smpte-tt+xml - Society of Motion Picture and Television Engineers - Timed Text (SMPTE-TT)
val luraConfiguration = LuraConfiguration(
...
content = LuraContent(
media = listOf(
LuraMedia(
type = "text/vtt",
url = "https://example.com/en.vtt",
language = "en"
),
LuraMedia(
type = "application/ttml+xml",
url = "https://example.com/es.xml",
language = "es"
),
...
),
...
),
...
)

playerView = findViewById(R.id.lura_player_view)
player = LuraPlayer(context = this, playerView = playerView)
player.setConfig(luraConfiguration)