fix: seek preview index

Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
bggRGjQaUbCoE
2025-01-29 23:40:03 +08:00
parent 0fd232ab3a
commit a5a13b45cf
2 changed files with 12 additions and 5 deletions

View File

@@ -1511,7 +1511,13 @@ Widget buildSeekPreviewWidget(PlPlayerController plPlayerController) {
.clamp(8, constraints.maxWidth - 48 * scale - 8);
// index
int index = plPlayerController.sliderPositionSeconds.value ~/ 5;
// int index = plPlayerController.sliderPositionSeconds.value ~/ 5;
int index = (List<int>.from(
plPlayerController.videoShot!['data']['index'])
.where((item) =>
item <= plPlayerController.sliderPositionSeconds.value)
.length -
2);
// pageIndex
int pageIndex = (index ~/ 100).clamp(
@@ -1560,7 +1566,8 @@ Widget buildSeekPreviewWidget(PlPlayerController plPlayerController) {
),
),
);
} catch (_) {
} catch (e) {
debugPrint('seek preview: $e');
return SizedBox.shrink(
key: ValueKey(plPlayerController.localPosition.value),
);