mirror of
https://github.com/HChaZZY/PiliPlus.git
synced 2025-12-06 09:13:48 +08:00
fix: 改善全屏体验,增加额外横屏设置,替换全屏实现方法
This commit is contained in:
@@ -31,7 +31,6 @@ Box localCache = GStrorage.localCache;
|
||||
class PlPlayerController {
|
||||
Player? _videoPlayerController;
|
||||
VideoController? _videoController;
|
||||
void Function({bool? status})? triggerFullscreenCallback;
|
||||
|
||||
// 添加一个私有静态变量来保存实例
|
||||
static PlPlayerController? _instance;
|
||||
@@ -233,11 +232,6 @@ class PlPlayerController {
|
||||
// 播放顺序相关
|
||||
PlayRepeat playRepeat = PlayRepeat.pause;
|
||||
|
||||
void setTriggerFullscreenCallback(
|
||||
void Function({bool? status}) triggerFullscreenCallback) {
|
||||
this.triggerFullscreenCallback = triggerFullscreenCallback;
|
||||
}
|
||||
|
||||
void updateSliderPositionSecond() {
|
||||
int newSecond = _sliderPosition.value.inSeconds;
|
||||
if (sliderPositionSeconds.value != newSecond) {
|
||||
@@ -967,9 +961,6 @@ class PlPlayerController {
|
||||
await landScape();
|
||||
}
|
||||
|
||||
if (triggerFullscreenCallback != null) {
|
||||
triggerFullscreenCallback!(status: status);
|
||||
}
|
||||
} else if (isFullScreen.value && !status) {
|
||||
if (!setting.get(SettingBoxKey.horizontalScreen, defaultValue: false)) {
|
||||
StatusBarControl.setHidden(false, animation: StatusBarAnimation.FADE);
|
||||
@@ -978,9 +969,6 @@ class PlPlayerController {
|
||||
}
|
||||
exitFullScreen();
|
||||
toggleFullScreen(false);
|
||||
if (triggerFullscreenCallback != null) {
|
||||
triggerFullscreenCallback!(status: status);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -15,16 +15,14 @@ Future<void> landScape() async {
|
||||
if (kIsWeb) {
|
||||
await document.documentElement?.requestFullscreen();
|
||||
} else if (Platform.isAndroid || Platform.isIOS) {
|
||||
// await SystemChrome.setEnabledSystemUIMode(
|
||||
// SystemUiMode.immersiveSticky,
|
||||
// overlays: [],
|
||||
// );
|
||||
// await SystemChrome.setPreferredOrientations(
|
||||
// [
|
||||
// DeviceOrientation.landscapeLeft,
|
||||
// DeviceOrientation.landscapeRight,
|
||||
// ],
|
||||
// );
|
||||
if (setting.get(SettingBoxKey.lockLandscape, defaultValue: false)) {
|
||||
await SystemChrome.setPreferredOrientations(
|
||||
[
|
||||
DeviceOrientation.landscapeLeft,
|
||||
DeviceOrientation.landscapeRight,
|
||||
],
|
||||
);
|
||||
}
|
||||
await AutoOrientation.landscapeAutoMode(forceSensor: true);
|
||||
} else if (Platform.isMacOS || Platform.isWindows || Platform.isLinux) {
|
||||
await const MethodChannel('com.alexmercerind/media_kit_video')
|
||||
|
||||
Reference in New Issue
Block a user