decord/source/stores/native/MobileVoiceOverlayStore.tsx

65 lines
2.2 KiB
TypeScript
Raw Normal View History

// Module ID: 10072
// Function ID: 10073
// Name: MobileVoiceOverlayStore
// Dependencies: [1074, 1242, 1115, 1608, 504, 573, 2]
2026-07-29 08:29:29 +00:00
// Exports: isMobileOverlaySupported
2026-07-20 16:05:17 +00:00
// Module 10072 (MobileVoiceOverlayStore)
import initializeDefault from "initialize" /* 504 */;
import DispatcherDefault from "Dispatcher" /* 573 */;
import Constants from "Constants" /* 1074 */;
import PlatformUtils from "PlatformUtils" /* 1115 */;
import AnalyticsUtilsDefault from "AnalyticsUtils" /* 1242 */;
import MetaQuestUtils from "MetaQuestUtils" /* 1608 */;
import size from "module_2" /* 2 */;
2026-07-23 10:11:24 +00:00
const AnalyticEvents = Constants.AnalyticEvents;
let enabled = false;
2026-08-24 06:08:38 +00:00
const DeviceSettingsStore = initializeDefault.DeviceSettingsStore;
2026-07-29 08:29:29 +00:00
class MobileVoiceOverlayStore extends DeviceSettingsStore {
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
const prototype = MobileVoiceOverlayStore.prototype;
prototype["getUserAgnosticState"] = function getUserAgnosticState() {
return { enabled };
2026-07-29 08:29:29 +00:00
};
prototype["initialize"] = function initialize(enabled) {
let flag;
if (enabled != null) {
flag = enabled.enabled;
}
if (flag == null) {
flag = false;
}
enabled = flag;
2026-07-29 08:29:29 +00:00
};
prototype["getEnabled"] = function getEnabled() {
let isAndroidResult = PlatformUtils.isAndroid();
2026-07-20 16:05:17 +00:00
if (isAndroidResult) {
isAndroidResult = !MetaQuestUtils.isMetaQuest();
const tmpResult = MetaQuestUtils;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
if (isAndroidResult) {
isAndroidResult = enabled;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
return isAndroidResult;
};
MobileVoiceOverlayStore.displayName = "MobileVoiceOverlayStore";
MobileVoiceOverlayStore.persistKey = "MobileVoiceOverlayStore";
const mobileVoiceOverlayStore = new MobileVoiceOverlayStore(DispatcherDefault, {
2026-07-20 16:05:17 +00:00
MOBILE_VOICE_OVERLAY_STATE_CHANGED: function handleMobileVoiceOverlayStateChanged(enabled) {
AnalyticsUtilsDefault.track(AnalyticEvents.MOBILE_OVERLAY_TOGGLED, { enabled: enabled.enabled });
2026-07-20 16:05:17 +00:00
enabled = enabled.enabled;
}
});
const result = size.fileFinishedImporting("stores/native/MobileVoiceOverlayStore.tsx");
2026-07-20 16:05:17 +00:00
2026-07-29 08:29:29 +00:00
export default mobileVoiceOverlayStore;
export const isMobileOverlaySupported = function isMobileOverlaySupported() {
let isAndroidResult = PlatformUtils.isAndroid();
2026-07-29 08:29:29 +00:00
if (isAndroidResult) {
isAndroidResult = !MetaQuestUtils.isMetaQuest();
const tmpResult = MetaQuestUtils;
2026-07-29 08:29:29 +00:00
}
return isAndroidResult;
};