diff --git a/lib/pages/setting/extra_setting.dart b/lib/pages/setting/extra_setting.dart index e0467456..c9d13623 100644 --- a/lib/pages/setting/extra_setting.dart +++ b/lib/pages/setting/extra_setting.dart @@ -139,6 +139,13 @@ class _ExtraSettingState extends State { ), body: ListView( children: [ + const SetSwitchItem( + title: 'Sponsor Block', + subTitle: '跳过赞助商广告', + leading: Icon(Icons.block), + setKey: SettingBoxKey.enableSponsorBlock, + defaultVal: false, + ), Obx( () => ListTile( enableFeedback: true, diff --git a/lib/pages/video/detail/controller.dart b/lib/pages/video/detail/controller.dart index 16ffaa2d..2425c06e 100644 --- a/lib/pages/video/detail/controller.dart +++ b/lib/pages/video/detail/controller.dart @@ -151,7 +151,9 @@ class VideoDetailController extends GetxController cacheAudioQa = setting.get(SettingBoxKey.defaultAudioQa, defaultValue: AudioQuality.hiRes.code); oid.value = IdUtils.bv2av(Get.parameters['bvid']!); - _sponsorBlock(); + if (setting.get(SettingBoxKey.enableSponsorBlock, defaultValue: false)) { + _sponsorBlock(); + } } List? _segmentList; diff --git a/lib/utils/storage.dart b/lib/utils/storage.dart index ba1aa973..47f16c22 100644 --- a/lib/utils/storage.dart +++ b/lib/utils/storage.dart @@ -188,6 +188,7 @@ class SettingBoxKey { enableAi = 'enableAi', disableLikeMsg = 'disableLikeMsg', defaultHomePage = 'defaultHomePage', + enableSponsorBlock = 'enableSponsorBlock', // 弹幕相关设置 权重(云屏蔽) 屏蔽类型 显示区域 透明度 字体大小 弹幕时间 描边粗细 字体粗细 danmakuWeight = 'danmakuWeight',