feat: 新增弹幕描边粗细设置,默认值降低

This commit is contained in:
orz12
2024-01-25 11:36:20 +08:00
parent e052c6eafe
commit bf8ae0f317
4 changed files with 51 additions and 1 deletions

View File

@ -221,6 +221,7 @@ class PlPlayerController {
late double showArea;
late double opacityVal;
late double fontSizeVal;
late double strokeWidth;
late double danmakuDurationVal;
late List<double> speedsList;
// 缓存
@ -275,6 +276,9 @@ class PlPlayerController {
// 弹幕时间
danmakuDurationVal =
localCache.get(LocalCacheKey.danmakuDuration, defaultValue: 4.0);
// 描边粗细
strokeWidth =
localCache.get(LocalCacheKey.strokeWidth, defaultValue: 1.5);
playRepeat = PlayRepeat.values.toList().firstWhere(
(e) =>
e.value ==
@ -1086,6 +1090,7 @@ class PlPlayerController {
localCache.put(LocalCacheKey.danmakuOpacity, opacityVal);
localCache.put(LocalCacheKey.danmakuFontScale, fontSizeVal);
localCache.put(LocalCacheKey.danmakuDuration, danmakuDurationVal);
localCache.put(LocalCacheKey.strokeWidth, strokeWidth);
if (_videoPlayerController != null) {
var pp = _videoPlayerController!.platform as NativePlayer;
await pp.setProperty('audio-files', '');