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

37 lines
1.4 KiB
TypeScript
Raw Normal View History

2026-08-25 06:04:03 +00:00
// Module ID: 11343
// Function ID: 11344
2026-08-12 06:57:52 +00:00
// Name: applyOrientationLock
2026-08-25 06:04:03 +00:00
// Dependencies: [9900, 9042, 2]
2026-08-12 06:57:52 +00:00
// Exports: applyOrientationLock, releaseOrientationLock, restoreDefaultOrientationLock
2026-08-25 06:04:03 +00:00
// Module 11343 (applyOrientationLock)
2026-08-24 06:08:38 +00:00
import set from "set" /* 2 */;
2026-08-25 06:04:03 +00:00
import handleOrientationChange from "handleOrientationChange" /* 9042 */;
import isOrientationLockSupportedDefault from "isOrientationLockSupported" /* 9900 */;
2026-08-24 06:08:38 +00:00
let result = set.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()) {
handleOrientationChange.lockOrientation(PORTRAIT, flag);
const obj = handleOrientationChange;
2026-08-12 06:57:52 +00:00
}
};
export const releaseOrientationLock = function releaseOrientationLock(unlockAfterRotatingToPreviousLock) {
2026-08-24 06:08:38 +00:00
if (isOrientationLockSupportedDefault()) {
let obj = handleOrientationChange;
2026-08-12 06:57:52 +00:00
obj = { unlockAfterRotatingToPreviousLock: null };
obj[0] = unlockAfterRotatingToPreviousLock.unlockAfterRotatingToPreviousLock;
obj.unlockOrientation(obj);
}
};
export const restoreDefaultOrientationLock = function restoreDefaultOrientationLock() {
2026-08-24 06:08:38 +00:00
if (isOrientationLockSupportedDefault()) {
const result = handleOrientationChange.restoreDefaultOrientation();
const obj = handleOrientationChange;
2026-08-12 06:57:52 +00:00
}
};