decord/alpha/source/modules/device/native/applyOrientationLock.tsx
2026-10-09 10:00:15 +00:00

36 lines
1.4 KiB
TypeScript

// Module ID: 12939
// Function ID: 12940
// Name: applyOrientationLock
// Dependencies: [10325, 8434, 2]
// Exports: applyOrientationLock, releaseOrientationLock, restoreDefaultOrientationLock
// Module 12939 (applyOrientationLock)
import DeviceOrientation from "DeviceOrientation" /* 8434 */;
import isOrientationLockSupportedDefault from "isOrientationLockSupported" /* 10325 */;
import size from "module_2" /* 2 */;
let result = size.fileFinishedImporting("modules/device/native/applyOrientationLock.tsx");
export const applyOrientationLock = function applyOrientationLock(PORTRAIT, flag) {
if (flag === undefined) {
flag = true;
}
if (isOrientationLockSupportedDefault()) {
const obj = DeviceOrientation;
obj.lockOrientation(PORTRAIT, flag);
}
};
export const releaseOrientationLock = function releaseOrientationLock(unlockAfterRotatingToPreviousLock) {
unlockAfterRotatingToPreviousLock = unlockAfterRotatingToPreviousLock.unlockAfterRotatingToPreviousLock;
if (isOrientationLockSupportedDefault()) {
const obj2 = { unlockAfterRotatingToPreviousLock };
const obj = DeviceOrientation;
obj.unlockOrientation(obj2);
}
};
export const restoreDefaultOrientationLock = function restoreDefaultOrientationLock() {
if (isOrientationLockSupportedDefault()) {
const obj = DeviceOrientation;
const result = obj.restoreDefaultOrientation();
}
};