mod: video playing logic

This commit is contained in:
bggRGjQaUbCoE
2024-09-21 17:22:13 +08:00
parent 3263ff8949
commit 7707a78489
2 changed files with 24 additions and 2 deletions

View File

@@ -290,9 +290,18 @@ class PlPlayerController {
return _instance != null;
}
static void setPlayCallBack(Function? playCallBack) {
_playCallBack = playCallBack;
}
static Function? _playCallBack;
static Future<void> playIfExists(
{bool repeat = false, bool hideControls = true}) async {
await _instance?.play(repeat: repeat, hideControls: hideControls);
// await _instance?.play(repeat: repeat, hideControls: hideControls);
if (_playCallBack != null) {
_playCallBack!();
}
}
// try to get PlayerStatus
@@ -1370,4 +1379,8 @@ class PlPlayerController {
));
_vttSubtitlesIndex.value = index;
}
static void updatePlayCount() {
_instance?._playerCount.value -= 1;
}
}