From c586175322fdf0930bb450483174b2bc7bed5688 Mon Sep 17 00:00:00 2001 From: "google-labs-jules[bot]" <161369871+google-labs-jules[bot]@users.noreply.github.com> Date: Sun, 14 Dec 2025 14:51:29 +0000 Subject: [PATCH 1/4] feat: Add subtitle toggle and selection to player settings Adds a "Subtitles" button to open the subtitle selection menu and a "Toggle Subtitles" switch to the player's "more settings" menu. --- lib/pages/video/widgets/header_control.dart | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/lib/pages/video/widgets/header_control.dart b/lib/pages/video/widgets/header_control.dart index a5cd333757..687c5840d8 100644 --- a/lib/pages/video/widgets/header_control.dart +++ b/lib/pages/video/widgets/header_control.dart @@ -1330,6 +1330,23 @@ class HeaderControlState extends State leading: const Icon(Icons.subtitles_outlined, size: 20), title: const Text('字幕', style: titleStyle), ), + SwitchListTile( + value: videoDetailCtr.subtitle.value > 0, + onChanged: (value) { + videoDetailCtr.setSubtitle(value ? 1 : 0); + }, + secondary: const Icon(Icons.subtitles_outlined, size: 20), + title: const Text('开启字幕', style: titleStyle), + ), + ListTile( + dense: true, + onTap: () { + Get.back(); + showSetSubtitle(); + }, + leading: const Icon(Icons.subtitles_outlined, size: 20), + title: const Text('字幕', style: titleStyle), + ), ListTile( dense: true, onTap: () { From 49fea21a428bf196fdc418bb856b38b8f78f8fa6 Mon Sep 17 00:00:00 2001 From: "google-labs-jules[bot]" <161369871+google-labs-jules[bot]@users.noreply.github.com> Date: Sun, 14 Dec 2025 14:57:30 +0000 Subject: [PATCH 2/4] fix: Correctly implement subtitle selection menu This change corrects the implementation of the "Subtitles" button in the player's "more settings" menu. Instead of navigating to the subtitle settings page, the button now opens a bottom sheet that allows the user to select the subtitle language, similar to the playback speed control. --- lib/pages/video/widgets/header_control.dart | 56 ++++++++++++++++++++- 1 file changed, 55 insertions(+), 1 deletion(-) diff --git a/lib/pages/video/widgets/header_control.dart b/lib/pages/video/widgets/header_control.dart index 687c5840d8..cbdf2700b5 100644 --- a/lib/pages/video/widgets/header_control.dart +++ b/lib/pages/video/widgets/header_control.dart @@ -131,6 +131,60 @@ mixin TimeBatteryMixin on State { ); } + /// 选择字幕 + void showSelectSubtitle() { + showBottomSheet( + (context, setState) { + final theme = Theme.of(context); + return Padding( + padding: const EdgeInsets.all(12), + child: Material( + clipBehavior: Clip.hardEdge, + color: theme.colorScheme.surface, + borderRadius: const BorderRadius.all(Radius.circular(12)), + child: CustomScrollView( + slivers: [ + const SliverToBoxAdapter( + child: SizedBox( + height: 45, + child: Center( + child: Text('选择字幕', style: titleStyle), + ), + ), + ), + SliverList.builder( + itemCount: videoDetailCtr.subtitles.length + 1, + itemBuilder: (context, index) { + final bool isCurrent = videoDetailCtr.subtitle.value == index; + return ListTile( + dense: true, + onTap: () { + Get.back(); + videoDetailCtr.setSubtitle(index); + }, + contentPadding: const EdgeInsets.symmetric( + horizontal: 20, + ), + title: Text(index == 0 + ? '关闭' + : videoDetailCtr.subtitles[index - 1].lanDoc!), + trailing: isCurrent + ? Icon( + Icons.done, + color: theme.colorScheme.primary, + ) + : null, + ); + }, + ), + ], + ), + ), + ); + }, + ); + } + List? get timeBatteryWidgets { if (_showCurrTime) { return [ @@ -1325,7 +1379,7 @@ class HeaderControlState extends State dense: true, onTap: () { Get.back(); - showSetSubtitle(); + showSelectSubtitle(); }, leading: const Icon(Icons.subtitles_outlined, size: 20), title: const Text('字幕', style: titleStyle), From b73e042f95590795ee0f0ac73c80a442d7d6376c Mon Sep 17 00:00:00 2001 From: "google-labs-jules[bot]" <161369871+google-labs-jules[bot]@users.noreply.github.com> Date: Sun, 14 Dec 2025 15:13:10 +0000 Subject: [PATCH 3/4] fix: Fix CI build error Fixes a CI build error by using the correct property and method for toggling subtitles. --- lib/pages/video/widgets/header_control.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/pages/video/widgets/header_control.dart b/lib/pages/video/widgets/header_control.dart index cbdf2700b5..94450cb15e 100644 --- a/lib/pages/video/widgets/header_control.dart +++ b/lib/pages/video/widgets/header_control.dart @@ -1385,7 +1385,7 @@ class HeaderControlState extends State title: const Text('字幕', style: titleStyle), ), SwitchListTile( - value: videoDetailCtr.subtitle.value > 0, + value: videoDetailCtr.vttSubtitlesIndex.value > 0, onChanged: (value) { videoDetailCtr.setSubtitle(value ? 1 : 0); }, From 0701b0f981948258a1968f12ae08d0220aa7b672 Mon Sep 17 00:00:00 2001 From: "google-labs-jules[bot]" <161369871+google-labs-jules[bot]@users.noreply.github.com> Date: Sun, 14 Dec 2025 15:23:47 +0000 Subject: [PATCH 4/4] feat: Add more buttons to player settings menu This change adds several new buttons and controls to the player's "more settings" menu to provide users with more control over the video playback experience. The following features have been added: - Playback Speed selection - Aspect Ratio selection - Picture-in-Picture button - Episode Selection button - High-Energy Progress Bar toggle - Toggle Danmaku switch - Subtitle language selection - Toggle Subtitles switch - Back and Back to Home navigation buttons This also includes fixes for several CI build errors encountered during development.