# Subtitle
ByteArk Player SDK for Flutter supports subtitles embedded in the HLS manifest, with customizable appearance, and a viewer-facing picker through the player UI.
# Style subtitle appearance
final config = ByteArkPlayerConfig(
licenseKey: licenseKey,
playerItem: playerItem,
subtitleSize: ByteArkPlayerSubtitleSize.medium,
subtitleBackgroundEnabled: true,
subtitlePaddingBottomPercentage: 10,
);
1
2
3
4
5
6
7
2
3
4
5
6
7
| Property | Type | Default | Description |
|---|---|---|---|
subtitleSize | ByteArkPlayerSubtitleSize? | medium | Font size as a percentage of video height (see below) |
subtitleBackgroundEnabled | bool? | true | Show subtitle background |
subtitlePaddingBottomPercentage | int? | 10 | Bottom padding (%) |
ByteArkPlayerSubtitleSize is an enum sized as a percentage of the video height:
| Value | Size |
|---|---|
minimum | 1% |
extraTiny | 2% |
tiny | 3% |
extraSmall | 4% |
small | 5% |
medium (default) | 6% |
large | 7% |
extraLarge | 8% |
maximum | 9% |
# Select subtitle via API
// Select a subtitle
_controller.setSubtitle(track);
// Disable subtitle
_controller.setSubtitle(null);
1
2
3
4
5
2
3
4
5