Skip to content

Commit

Permalink
add default danmaku switcher (#92)
Browse files Browse the repository at this point in the history
  • Loading branch information
Predidit committed Jul 27, 2024
1 parent c350ca9 commit 9a8d675
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 0 deletions.
1 change: 1 addition & 0 deletions lib/pages/player/player_item.dart
Original file line number Diff line number Diff line change
Expand Up @@ -412,6 +412,7 @@ class _PlayerItemState extends State<PlayerItem>
Provider.of<SideNavigationBarState>(context, listen: false);
}
webDavEnable = setting.get(SettingBoxKey.webDavEnable, defaultValue: false);
playerController.danmakuOn = setting.get(SettingBoxKey.danmakuEnabledByDefault, defaultValue: false);
_border = setting.get(SettingBoxKey.danmakuBorder, defaultValue: true);
_opacity = setting.get(SettingBoxKey.danmakuOpacity, defaultValue: 1.0);
_duration = 8;
Expand Down
8 changes: 8 additions & 0 deletions lib/pages/settings/danmaku_settings.dart
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,14 @@ class _DanmakuSettingsPageState extends State<DanmakuSettingsPage> {
appBar: const SysAppBar(title: Text('弹幕设置')),
body: ListView(
children: [
const InkWell(
child: SetSwitchItem(
title: '默认开启',
subTitle: '默认是否随视频播放弹幕',
setKey: SettingBoxKey.danmakuEnabledByDefault,
defaultVal: false,
),
),
const InkWell(
child: SetSwitchItem(
title: '弹幕描边',
Expand Down
1 change: 1 addition & 0 deletions lib/utils/storage.dart
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@ class SettingBoxKey {
danmakuMassive = 'danmakuMassive',
danmakuArea = 'danmakuArea',
danmakuColor = 'danmakuColor',
danmakuEnabledByDefault = 'danmakuEnabledByDefault',
themeMode = 'themeMode',
themeColor = 'themeColor',
privateMode = 'privateMode',
Expand Down

0 comments on commit 9a8d675

Please sign in to comment.