mirror of
https://github.com/bggRGjQaUbCoE/PiliPlus.git
synced 2026-07-16 14:20:13 +08:00
@@ -1120,7 +1120,7 @@ class VideoDetailController extends GetxController
|
||||
playerInit();
|
||||
}
|
||||
|
||||
FutureOr<void> _initPlayerIfNeeded() {
|
||||
Future<void>? _initPlayerIfNeeded() {
|
||||
if (autoPlay.value ||
|
||||
(plPlayerController.preInitPlayer && !plPlayerController.processing) &&
|
||||
(isFileSource
|
||||
@@ -1128,6 +1128,7 @@ class VideoDetailController extends GetxController
|
||||
: videoPlayerKey.currentState?.mounted == true)) {
|
||||
return playerInit();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
Future<void> playerInit({
|
||||
|
||||
@@ -38,10 +38,16 @@ class NoteListPage extends CommonSlidePage {
|
||||
|
||||
class _NoteListPageState extends State<NoteListPage>
|
||||
with SingleTickerProviderStateMixin, CommonSlideMixin {
|
||||
late final _controller = Get.put(
|
||||
NoteListPageCtr(oid: widget.oid),
|
||||
tag: widget.heroTag,
|
||||
);
|
||||
late final NoteListPageCtr _controller;
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
_controller = Get.put(
|
||||
NoteListPageCtr(oid: widget.oid),
|
||||
tag: widget.heroTag,
|
||||
);
|
||||
}
|
||||
|
||||
@override
|
||||
void dispose() {
|
||||
|
||||
@@ -22,10 +22,16 @@ class ReplySearchPage extends StatefulWidget {
|
||||
}
|
||||
|
||||
class _ReplySearchPageState extends State<ReplySearchPage> {
|
||||
late final _controller = Get.put(
|
||||
ReplySearchController(widget.type, widget.oid),
|
||||
tag: Utils.generateRandomString(8),
|
||||
);
|
||||
late final ReplySearchController _controller;
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
_controller = Get.put(
|
||||
ReplySearchController(widget.type, widget.oid),
|
||||
tag: Utils.generateRandomString(8),
|
||||
);
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
|
||||
@@ -22,6 +22,7 @@ class PlayerFocus extends StatelessWidget {
|
||||
required this.onSendDanmaku,
|
||||
this.canPlay,
|
||||
this.onSkipSegment,
|
||||
this.onRefresh,
|
||||
});
|
||||
|
||||
final Widget child;
|
||||
@@ -30,6 +31,7 @@ class PlayerFocus extends StatelessWidget {
|
||||
final VoidCallback onSendDanmaku;
|
||||
final ValueGetter<bool>? canPlay;
|
||||
final ValueGetter<bool>? onSkipSegment;
|
||||
final VoidCallback? onRefresh;
|
||||
|
||||
static bool _shouldHandle(LogicalKeyboardKey logicalKey) {
|
||||
return logicalKey == LogicalKeyboardKey.tab ||
|
||||
@@ -93,12 +95,14 @@ class PlayerFocus extends StatelessWidget {
|
||||
if (HardwareKeyboard.instance.isMetaPressed) {
|
||||
return true;
|
||||
}
|
||||
if (!plPlayerController.isLive) {
|
||||
if (event is KeyDownEvent) {
|
||||
if (event is KeyDownEvent) {
|
||||
if (plPlayerController.isLive) {
|
||||
onRefresh?.call();
|
||||
} else {
|
||||
introController!.onStartTriple();
|
||||
} else if (event is KeyUpEvent) {
|
||||
introController!.onCancelTriple(isKeyQ);
|
||||
}
|
||||
} else if (event is KeyUpEvent && !plPlayerController.isLive) {
|
||||
introController!.onCancelTriple(isKeyQ);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user