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

37 lines
1.4 KiB
TypeScript
Raw Normal View History

2026-10-07 22:43:51 +00:00
// Module ID: 10964
// Function ID: 10965
// Name: applyOrientationLock
2026-10-07 22:43:51 +00:00
// Dependencies: [9055, 8008, 2]
// Exports: applyOrientationLock, releaseOrientationLock, restoreDefaultOrientationLock
2026-10-07 22:43:51 +00:00
// Module 10964 (applyOrientationLock)
import DeviceOrientation from "DeviceOrientation" /* 8008 */;
import isOrientationLockSupportedDefault from "isOrientationLockSupported" /* 9055 */;
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()) {
2026-10-01 14:13:23 +00:00
const obj = DeviceOrientation;
obj.lockOrientation(PORTRAIT, flag);
}
};
export const releaseOrientationLock = function releaseOrientationLock(unlockAfterRotatingToPreviousLock) {
2026-10-01 14:13:23 +00:00
unlockAfterRotatingToPreviousLock = unlockAfterRotatingToPreviousLock.unlockAfterRotatingToPreviousLock;
if (isOrientationLockSupportedDefault()) {
2026-10-01 14:13:23 +00:00
const obj2 = { unlockAfterRotatingToPreviousLock };
const obj = DeviceOrientation;
obj.unlockOrientation(obj2);
}
};
export const restoreDefaultOrientationLock = function restoreDefaultOrientationLock() {
if (isOrientationLockSupportedDefault()) {
2026-10-01 14:13:23 +00:00
const obj = DeviceOrientation;
const result = obj.restoreDefaultOrientation();
}
};