mirror of
https://github.com/HChaZZY/PiliPlus.git
synced 2025-12-06 09:13:48 +08:00
feat: custom subtitle bg stroke
Closes #90 Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
@@ -260,12 +260,18 @@ class PlPlayerController {
|
||||
late int subtitlePaddingH = GStorage.subtitlePaddingH;
|
||||
late int subtitlePaddingB = GStorage.subtitlePaddingB;
|
||||
late double subtitleBgOpaticy = GStorage.subtitleBgOpaticy;
|
||||
late double subtitleBgStroke = GStorage.subtitleBgStroke;
|
||||
|
||||
// 播放顺序相关
|
||||
PlayRepeat playRepeat = PlayRepeat.pause;
|
||||
|
||||
final GlobalKey<VideoState> key = GlobalKey<VideoState>();
|
||||
|
||||
Paint get subtitleBg => Paint()
|
||||
..style = PaintingStyle.stroke
|
||||
..strokeWidth = subtitleBgStroke
|
||||
..color = Colors.black;
|
||||
|
||||
TextStyle get subTitleStyle => TextStyle(
|
||||
height: 1.5,
|
||||
fontSize:
|
||||
@@ -274,7 +280,11 @@ class PlPlayerController {
|
||||
wordSpacing: 0.1,
|
||||
color: Colors.white,
|
||||
fontWeight: FontWeight.normal,
|
||||
backgroundColor: Colors.black.withOpacity(subtitleBgOpaticy),
|
||||
background:
|
||||
subtitleBgOpaticy == 0 && subtitleBgStroke != 0 ? subtitleBg : null,
|
||||
backgroundColor: subtitleBgOpaticy == 0
|
||||
? null
|
||||
: Colors.black.withOpacity(subtitleBgOpaticy),
|
||||
);
|
||||
|
||||
SubtitleViewConfiguration get subtitleViewConfiguration =>
|
||||
@@ -1340,6 +1350,7 @@ class PlPlayerController {
|
||||
setting.put(SettingBoxKey.subtitlePaddingH, subtitlePaddingH);
|
||||
setting.put(SettingBoxKey.subtitlePaddingB, subtitlePaddingB);
|
||||
setting.put(SettingBoxKey.subtitleBgOpaticy, subtitleBgOpaticy);
|
||||
setting.put(SettingBoxKey.subtitleBgStroke, subtitleBgStroke);
|
||||
}
|
||||
|
||||
Future<void> dispose({String type = 'single'}) async {
|
||||
|
||||
Reference in New Issue
Block a user