decord/alpha/source/modules/device/native/applyOrientationLock.tsx

37 lines
1.4 KiB
TypeScript
Raw Normal View History

2026-10-09 10:00:15 +00:00
// Module ID: 12939
// Function ID: 12940
2026-08-12 06:57:52 +00:00
// Name: applyOrientationLock
2026-10-09 10:00:15 +00:00
// Dependencies: [10325, 8434, 2]
2026-08-12 06:57:52 +00:00
// Exports: applyOrientationLock, releaseOrientationLock, restoreDefaultOrientationLock
2026-10-09 10:00:15 +00:00
// Module 12939 (applyOrientationLock)
import DeviceOrientation from "DeviceOrientation" /* 8434 */;
import isOrientationLockSupportedDefault from "isOrientationLockSupported" /* 10325 */;
import size from "module_2" /* 2 */;
2026-08-24 06:08:38 +00:00
let result = size.fileFinishedImporting("modules/device/native/applyOrientationLock.tsx");
2026-08-12 06:57:52 +00:00
export const applyOrientationLock = function applyOrientationLock(PORTRAIT, flag) {
if (flag === undefined) {
flag = true;
}
2026-08-24 06:08:38 +00:00
if (isOrientationLockSupportedDefault()) {
2026-10-03 08:58:59 +00:00
const obj = DeviceOrientation;
obj.lockOrientation(PORTRAIT, flag);
2026-08-12 06:57:52 +00:00
}
};
export const releaseOrientationLock = function releaseOrientationLock(unlockAfterRotatingToPreviousLock) {
2026-10-03 08:58:59 +00:00
unlockAfterRotatingToPreviousLock = unlockAfterRotatingToPreviousLock.unlockAfterRotatingToPreviousLock;
2026-08-24 06:08:38 +00:00
if (isOrientationLockSupportedDefault()) {
2026-10-03 08:58:59 +00:00
const obj2 = { unlockAfterRotatingToPreviousLock };
const obj = DeviceOrientation;
obj.unlockOrientation(obj2);
2026-08-12 06:57:52 +00:00
}
};
export const restoreDefaultOrientationLock = function restoreDefaultOrientationLock() {
2026-08-24 06:08:38 +00:00
if (isOrientationLockSupportedDefault()) {
2026-10-03 08:58:59 +00:00
const obj = DeviceOrientation;
const result = obj.restoreDefaultOrientation();
2026-08-12 06:57:52 +00:00
}
};