fix(exoplayer): apply subtitle styling

This commit is contained in:
edde746
2026-02-06 05:46:07 +01:00
parent f3fbdad4dc
commit 3d255f9920
6 changed files with 162 additions and 18 deletions
+28
View File
@@ -261,6 +261,34 @@ class PlayerAndroid extends PlayerBase {
}
}
// ============================================
// Subtitle Styling (ExoPlayer Native)
// ============================================
/// Apply subtitle styling to the native ExoPlayer layer.
///
/// For non-ASS subtitles, applies CaptionStyleCompat (color, border, background).
/// For ASS subtitles, applies font scale via libass setFontScale().
Future<void> setSubtitleStyle({
required double fontSize,
required String textColor,
required double borderSize,
required String borderColor,
required String bgColor,
required int bgOpacity,
}) async {
checkDisposed();
if (!initialized) return;
await methodChannel.invokeMethod('setSubtitleStyle', {
'fontSize': fontSize,
'textColor': textColor,
'borderSize': borderSize,
'borderColor': borderColor,
'bgColor': bgColor,
'bgOpacity': bgOpacity,
});
}
// ============================================
// Frame Rate Matching
// ============================================