feat: save subtitle

Closes #495

Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
bggRGjQaUbCoE
2025-03-23 16:00:01 +08:00
parent d6587cf3b6
commit fd8559228e
4 changed files with 83 additions and 0 deletions

View File

@@ -1373,6 +1373,7 @@ class VideoDetailController extends GetxController
}
}
dynamic subtitles;
late List<Map<String, String>> _vttSubtitles = <Map<String, String>>[];
int? vttSubtitlesIndex;
late bool showVP = true;
@@ -1499,6 +1500,7 @@ class VideoDetailController extends GetxController
}
if (res["data"] is List && res["data"].isNotEmpty) {
subtitles = res["data"];
var result = await VideoHttp.vttSubtitles(res["data"]);
if (result != null) {
_vttSubtitles = result;
@@ -1569,6 +1571,7 @@ class VideoDetailController extends GetxController
savedDanmaku = null;
// subtitle
subtitles = null;
vttSubtitlesIndex = null;
_vttSubtitles.clear();