Subtitles & audio
The subtitle and audio menus fill themselves from the stream (embedded tracks) and from anything you sideload. Track objects and selection calls are identical on every platform.
Sideloading subtitle files
Section titled “Sideloading subtitle files”player.load( OGMediaItem.Builder(streamUrl) .setSideloadedSubtitles( listOf( SubtitleSource("https://…/en.vtt", language = "en", label = "English", isDefault = true), SubtitleSource("https://…/de.vtt", language = "de", label = "Deutsch"), ), ) .build(),)var item = OGMediaItem(urlString: streamUrl)!item.subtitles = [ SubtitleSource(urlString: "https://…/en.vtt", language: "en", label: "English", isDefault: true)!, SubtitleSource(urlString: "https://…/de.vtt", language: "de", label: "Deutsch")!,]player.load(item)player.load({ url: streamUrl, sideloadedSubtitles: [ { url: "https://…/en.vtt", language: "en", label: "English", isDefault: true }, { url: "https://…/de.vtt", language: "de", label: "Deutsch" }, ],});Positioned WebVTT cues (line: / position: / align: settings) render
faithfully on all platforms.
Selecting tracks programmatically
Section titled “Selecting tracks programmatically”textTracks / audioTracks expose everything with an isSelected flag;
selectTextTrack(id) (or null/nil for off) and selectAudioTrack(id)
switch. Audio entries carry language and channel count — surfaced as proper
display names in the built-in menu.
Caption styling & size
Section titled “Caption styling & size”subtitleStyle controls colors, background, edge type and the base size
fraction; subtitleTextScale is a viewer-facing multiplier (the demos map it
to Small / Default / Large / X-Large chips). Sizing follows the player height
with sane clamps, matching TV-style caption behaviour.