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

37 lines
1.4 KiB
TypeScript
Raw Normal View History

2026-08-26 06:04:24 +00:00
// Module ID: 11415
// Function ID: 11416
2026-08-12 06:57:52 +00:00
// Name: applyOrientationLock
2026-08-26 06:04:24 +00:00
// Dependencies: [9967, 9110, 2]
2026-08-12 06:57:52 +00:00
// Exports: applyOrientationLock, releaseOrientationLock, restoreDefaultOrientationLock
2026-08-26 06:04:24 +00:00
// Module 11415 (applyOrientationLock)
2026-08-24 06:08:38 +00:00
import set from "set" /* 2 */;
2026-08-26 06:04:24 +00:00
import handleOrientationChange from "handleOrientationChange" /* 9110 */;
import isOrientationLockSupportedDefault from "isOrientationLockSupported" /* 9967 */;
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
}
};