mirror of
https://github.com/HChaZZY/PiliPlus.git
synced 2025-12-25 03:26:22 +08:00
mod: video playing logic
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user