NativeVideoPlayerSubtitleStyle class

Visual style AND position for sidecar subtitles rendered by the plugin's Flutter overlay (covers the caption customization requested in issue #29: size, colors, and where on the video the captions sit).

Applies to sidecar (VTT/SRT) subtitles only, with one exception: embeddedTextScale, which scales EMBEDDED native subtitle tracks (rendered by the platform caption renderers, issue #43). All other fields have no effect on embedded tracks.

To change the style at runtime, rebuild the NativeVideoPlayer widget with a new subtitleStyle (the overlay rebuilds immediately; embeddedTextScale is pushed to the platform renderer).

Annotations

Constructors

NativeVideoPlayerSubtitleStyle({double fontSize = 16, FontWeight fontWeight = FontWeight.w500, FontStyle fontStyle = FontStyle.normal, String? fontFamily, double? lineHeight, Color textColor = const Color(0xFFFFFFFF), Color backgroundColor = const Color(0xB3000000), Color? outlineColor, double outlineWidth = 0, Alignment alignment = Alignment.bottomCenter, EdgeInsets padding = const EdgeInsets.only(bottom: 24, left: 16, right: 16), TextAlign textAlign = TextAlign.center, double? fullscreenLandscapeFontSize, FontWeight? fullscreenLandscapeFontWeight, double? fullscreenLandscapeLineHeight, double embeddedTextScale = 1.0})
const

Properties

alignment Alignment
Where the cue block sits on the video surface: any Alignment (e.g. Alignment.bottomCenter default, Alignment.topCenter for top-positioned captions, Alignment.center, corners, ...).
final
backgroundColor Color
Background behind each cue line (translucent black by default).
final
embeddedTextScale double
Text-size scale for EMBEDDED subtitle tracks rendered by the platform (ExoPlayer's SubtitleView on Android, AVPlayer captions on iOS). 1.0 = platform default (the user's system caption size preference). Ignored by the sidecar overlay — use fontSize for that.
final
fontFamily String?
Custom font family; null uses the app's default.
final
fontSize double
final
fontStyle FontStyle
final
fontWeight FontWeight
final
fullscreenLandscapeFontSize double?
When the player is fullscreen AND in landscape, these override the base typography so captions can grow for the large-video experience. Each is null by default, falling back to the matching base value (fontSize / fontWeight / lineHeight). They have no effect inline or in fullscreen-portrait, where the base values are always used.
final
fullscreenLandscapeFontWeight FontWeight?
final
fullscreenLandscapeLineHeight double?
final
hashCode int
The hash code for this object.
no setterinherited
lineHeight double?
Line height multiplier (TextStyle.height); null uses the font default.
final
outlineColor Color?
Optional text outline for readability on busy video.
final
outlineWidth double
final
padding EdgeInsets
Space between the cue block and the video edges.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
textAlign TextAlign
Text alignment within multi-line cues.
final
textColor Color
final

Methods

copyWith({double? fontSize, FontWeight? fontWeight, FontStyle? fontStyle, String? fontFamily, double? lineHeight, Color? textColor, Color? backgroundColor, Color? outlineColor, double? outlineWidth, Alignment? alignment, EdgeInsets? padding, TextAlign? textAlign, double? fullscreenLandscapeFontSize, FontWeight? fullscreenLandscapeFontWeight, double? fullscreenLandscapeLineHeight, double? embeddedTextScale}) NativeVideoPlayerSubtitleStyle
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited