Skip to main content

Add Captions to Your Media

info

As of 2023, Samsung states that Tizen TV's are not optimized for .NET applications. Samsung strongly recommends using JS/Web applications instead of C#/.NET applications for TVs. Please check the Lura Player Web SDK

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.

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)
Caption Configuration
using Lura;
using Lura.Unified;
using Tizen.NUI;

// Initialize player
Window window = Window.Instance;
var player = new Player(window);

// Configure with multiple caption tracks
var config = new Configuration
{
Content = new ContentConfiguration
{
Media = new List<ContentMedia>
{
new ContentMedia
{
Url = "https://example.com/en.vtt",
Type = SubtitleMimeType.Vtt,
Language = "en"
},
new ContentMedia
{
Url = "https://example.com/es.xml",
Type = SubtitleMimeType.Ttml,
Language = "es"
}
}
}
};

// Set configuration
await player.SetConfig(config);
player.Play();