mirror of
https://github.com/bggRGjQaUbCoE/PiliPlus.git
synced 2026-06-01 00:28:18 +08:00
opt android orientation
Signed-off-by: dom <githubaccount56556@proton.me>
This commit is contained in:
@@ -531,7 +531,10 @@ class PlPlayerController with BlockConfigMixin {
|
|||||||
final isFullScreen = this.isFullScreen.value;
|
final isFullScreen = this.isFullScreen.value;
|
||||||
if (checkIsAutoRotate &&
|
if (checkIsAutoRotate &&
|
||||||
param.isAutoRotate != true &&
|
param.isAutoRotate != true &&
|
||||||
(!isFullScreen || _isVertical || orientation == .portraitUp)) {
|
(!isFullScreen ||
|
||||||
|
_isVertical ||
|
||||||
|
orientation == .portraitUp ||
|
||||||
|
orientation == .portraitDown)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
switch (orientation) {
|
switch (orientation) {
|
||||||
@@ -544,6 +547,10 @@ class PlPlayerController with BlockConfigMixin {
|
|||||||
} else {
|
} else {
|
||||||
portraitUpMode();
|
portraitUpMode();
|
||||||
}
|
}
|
||||||
|
case .portraitDown:
|
||||||
|
if (!horizontalScreen) return;
|
||||||
|
if (!_isVertical && controlsLock.value) return;
|
||||||
|
portraitDownMode();
|
||||||
case .landscapeLeft:
|
case .landscapeLeft:
|
||||||
if (!horizontalScreen && !isFullScreen) {
|
if (!horizontalScreen && !isFullScreen) {
|
||||||
triggerFullScreen(orientation: orientation, isManualFS: false);
|
triggerFullScreen(orientation: orientation, isManualFS: false);
|
||||||
@@ -556,13 +563,12 @@ class PlPlayerController with BlockConfigMixin {
|
|||||||
} else {
|
} else {
|
||||||
landscapeRightMode();
|
landscapeRightMode();
|
||||||
}
|
}
|
||||||
case _:
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// 添加一个私有构造函数
|
// 添加一个私有构造函数
|
||||||
PlPlayerController._() {
|
PlPlayerController._() {
|
||||||
if (PlatformUtils.isMobile && !horizontalScreen) {
|
if (PlatformUtils.isMobile) {
|
||||||
_orientationListener = NativeDeviceOrientationPlatform.instance
|
_orientationListener = NativeDeviceOrientationPlatform.instance
|
||||||
.onOrientationChanged(
|
.onOrientationChanged(
|
||||||
useSensor: Platform.isAndroid,
|
useSensor: Platform.isAndroid,
|
||||||
@@ -1438,7 +1444,6 @@ class PlPlayerController with BlockConfigMixin {
|
|||||||
if (status) {
|
if (status) {
|
||||||
if (PlatformUtils.isMobile) {
|
if (PlatformUtils.isMobile) {
|
||||||
hideStatusBar();
|
hideStatusBar();
|
||||||
if (horizontalScreen) return;
|
|
||||||
if (orientation == null && mode == .none) {
|
if (orientation == null && mode == .none) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -1584,7 +1589,9 @@ class PlPlayerController with BlockConfigMixin {
|
|||||||
bool get isCloseAll => _isCloseAll;
|
bool get isCloseAll => _isCloseAll;
|
||||||
|
|
||||||
void resetScreenRotation() {
|
void resetScreenRotation() {
|
||||||
if (!horizontalScreen) {
|
if (horizontalScreen) {
|
||||||
|
fullMode();
|
||||||
|
} else {
|
||||||
portraitUpMode();
|
portraitUpMode();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1251,7 +1251,7 @@ packages:
|
|||||||
description:
|
description:
|
||||||
path: "."
|
path: "."
|
||||||
ref: master
|
ref: master
|
||||||
resolved-ref: "64cbc7886f5a5a5ecb09a34aab0d8b9ee48d03d2"
|
resolved-ref: "240534adb4b4b5c2c7e6c4578b1fc052ce98d7fd"
|
||||||
url: "https://github.com/bggRGjQaUbCoE/flutter_native_device_orientation.git"
|
url: "https://github.com/bggRGjQaUbCoE/flutter_native_device_orientation.git"
|
||||||
source: git
|
source: git
|
||||||
version: "2.0.5"
|
version: "2.0.5"
|
||||||
|
|||||||
Reference in New Issue
Block a user