Skip to content

Commit

Permalink
danmaku debug
Browse files Browse the repository at this point in the history
  • Loading branch information
Predidit committed May 24, 2024
1 parent 9da3089 commit 3809d0e
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 22 deletions.
26 changes: 8 additions & 18 deletions lib/pages/player/player_item.dart
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ class _PlayerItemState extends State<PlayerItem> with WindowListener {
late DanmakuController danmakuController;
late NavigationBarState navigationBarState;
late bool isFavorite;
bool isPopping = false;

// 弹幕
final _danmuKey = GlobalKey();
Expand Down Expand Up @@ -129,9 +130,6 @@ class _PlayerItemState extends State<PlayerItem> with WindowListener {
void onBackPressed(BuildContext context) {
if (videoPageController.androidFullscreen) {
debugPrint('当前播放器全屏');
try {
// danmakuController.onClear();
} catch (_) {}
try {
playerController.exitFullScreen();
videoPageController.androidFullscreen = false;
Expand All @@ -142,7 +140,12 @@ class _PlayerItemState extends State<PlayerItem> with WindowListener {
}
}
debugPrint('当前播放器非全屏');
Navigator.of(context).pop();
// workaround on flutter 3.22.1
if (!isPopping) {
isPopping = true;
Navigator.of(context).pop();
}
// Navigator.of(context).pop();
}

// 选择倍速
Expand Down Expand Up @@ -656,20 +659,7 @@ class _PlayerItemState extends State<PlayerItem> with WindowListener {
icon:
const Icon(Icons.arrow_back),
onPressed: () {
if (videoPageController
.androidFullscreen ==
true) {
try {
danmakuController.onClear();
} catch (_) {}
playerController
.exitFullScreen();
videoPageController
.androidFullscreen =
false;
return;
}
Navigator.of(context).pop();
onBackPressed(context);
},
),
// 拖动条
Expand Down
4 changes: 2 additions & 2 deletions pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -778,10 +778,10 @@ packages:
description:
path: "."
ref: master
resolved-ref: "3caac264792c10a260272a95fc3ee64cc7a83467"
resolved-ref: "513081ee857cb557362d24f1548d53861ee5421d"
url: "https://github.com/Predidit/flutter_ns_danmaku"
source: git
version: "0.0.6"
version: "0.0.7"
octo_image:
dependency: transitive
description:
Expand Down
4 changes: 2 additions & 2 deletions pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,8 @@ dependencies:
webview_flutter: ^4.7.0
ns_danmaku:
git:
url: https://github.com/Predidit/flutter_ns_danmaku
ref: master
url: https://github.com/Predidit/flutter_ns_danmaku
ref: master
webview_windows:
git:
url: https://github.com/Predidit/flutter-webview-windows.git
Expand Down

0 comments on commit 3809d0e

Please sign in to comment.