Skip to content

Commit

Permalink
mod: 避免triggerFullscreenCallback重复调用
Browse files Browse the repository at this point in the history
  • Loading branch information
orz12 committed Feb 22, 2024
1 parent a88409e commit 9f7d800
Showing 1 changed file with 8 additions and 36 deletions.
44 changes: 8 additions & 36 deletions lib/plugin/pl_player/controller.dart
Original file line number Diff line number Diff line change
Expand Up @@ -391,7 +391,7 @@ class PlPlayerController {
setting.get(SettingBoxKey.enableAutoEnter, defaultValue: false);
if (autoEnterFullcreen && _isFirstTime) {
await Future.delayed(const Duration(milliseconds: 100));
triggerFullScreen();
triggerFullScreen(status: true);
}
} catch (err) {
dataStatus.status.value = DataStatus.error;
Expand Down Expand Up @@ -967,48 +967,20 @@ class PlPlayerController {
await landScape();
}

// bool isValid =
// direction.value == 'vertical' || mode == FullScreenMode.vertical
// ? true
// : false;
// var result = await showDialog(
// context: Get.context!,
// useSafeArea: false,
// builder: (context) => Dialog.fullscreen(
// backgroundColor: Colors.black,
// child: SafeArea(
// // 忽略手机安全区域
// top: isValid,
// left: false,
// right: false,
// bottom: isValid,
// child: PLVideoPlayer(
// controller: this,
// headerControl: headerControl,
// bottomControl: bottomControl,
// danmuWidget: danmuWidget,
// ),
// ),
// ),
// );
// if (result == null) {
// // 退出全屏
// StatusBarControl.setHidden(false, animation: StatusBarAnimation.FADE);
// exitFullScreen();
// await verticalScreen();
// toggleFullScreen(false);
// }
} else if (isFullScreen.value) {
if (triggerFullscreenCallback != null) {
triggerFullscreenCallback!(status: status);
}
} else if (isFullScreen.value && !status) {
if (!setting.get(SettingBoxKey.horizontalScreen, defaultValue: false)) {
StatusBarControl.setHidden(false, animation: StatusBarAnimation.FADE);
// Get.back();
// await verticalScreen();
}
exitFullScreen();
toggleFullScreen(false);
}
if (triggerFullscreenCallback != null) {
triggerFullscreenCallback!(status: status);
if (triggerFullscreenCallback != null) {
triggerFullscreenCallback!(status: status);
}
}
}

Expand Down

0 comments on commit 9f7d800

Please sign in to comment.