decord/alpha/source/modules/frames/native/FramesNativeManager.tsx

80 lines
2.7 KiB
TypeScript
Raw Normal View History

2026-10-06 11:16:32 +00:00
// Module ID: 9011
// Function ID: 9012
// Name: FramesNativeManager
2026-10-06 11:16:32 +00:00
// Dependencies: [17, 9000, 1370, 9012, 9013, 5715, 1126, 1375, 584, 2]
2026-07-20 16:05:17 +00:00
2026-10-06 11:16:32 +00:00
// Module 9011 (FramesNativeManager)
2026-10-03 08:58:59 +00:00
import react_native from "react-native" /* 17 */;
import DispatcherDefault from "Dispatcher" /* 584 */;
import intl2 from "intl" /* 1126 */;
import GlobalUtils from "GlobalUtils" /* 1375 */;
2026-10-06 11:16:32 +00:00
import actions_AlertActionCreatorsDefault from "actions/AlertActionCreators" /* 5715 */;
import react_nativeDefault from "react-native" /* 9012 */;
import FramesStore from "FramesStore" /* 9000 */;
2026-10-03 08:58:59 +00:00
import PlatformUtils from "utils/PlatformUtils" /* 1370 */;
2026-10-06 11:16:32 +00:00
import FramesManager from "FramesManager" /* 9013 */;
2026-10-03 08:58:59 +00:00
import size from "module_2" /* 2 */;
2026-07-23 10:11:24 +00:00
2026-10-03 08:58:59 +00:00
const NativeEventEmitter = react_native.NativeEventEmitter;
2026-07-20 16:05:17 +00:00
let nativeEventEmitter = null;
if (PlatformUtils.isAndroid()) {
2026-10-03 08:58:59 +00:00
let self = this;
const self2 = this;
nativeEventEmitter = new NativeEventEmitter(react_nativeDefault);
2026-07-29 08:29:29 +00:00
}
2026-10-03 08:58:59 +00:00
class FramesNativeManager extends FramesManager {
2026-07-29 08:29:29 +00:00
_initialize() {
2026-10-03 08:58:59 +00:00
const self = this;
super._initialize();
const lifecycleSubscription = this.lifecycleSubscription;
2026-07-29 08:29:29 +00:00
if (lifecycleSubscription != null) {
2026-10-03 08:58:59 +00:00
lifecycleSubscription.remove();
2026-07-29 08:29:29 +00:00
}
2026-10-03 08:58:59 +00:00
let addListenerResult;
const obj = nativeEventEmitter;
if (nativeEventEmitter != null) {
2026-07-29 08:29:29 +00:00
addListenerResult = obj.addListener("onHostDestroy", () => {
2026-10-03 08:58:59 +00:00
const allFrames = FramesStore.getAllFrames();
for (const item10007 of allFrames) {
let leaveFrameResult = self.leaveFrame(item10007.id);
continue;
2026-07-29 08:29:29 +00:00
}
});
}
2026-10-03 08:58:59 +00:00
this.lifecycleSubscription = addListenerResult;
2026-07-29 08:29:29 +00:00
}
_terminate() {
2026-10-03 08:58:59 +00:00
super._terminate();
const lifecycleSubscription = this.lifecycleSubscription;
2026-07-29 08:29:29 +00:00
if (lifecycleSubscription != null) {
2026-10-03 08:58:59 +00:00
lifecycleSubscription.remove();
2026-07-29 08:29:29 +00:00
}
}
2026-10-03 08:58:59 +00:00
showRPCDisconnectErrorUI(reason) {
let code;
let intl;
let message;
({ code, message } = reason);
const obj = { title: intl.formatToPlainString(intl2.t.hbiAO6, { code }), body: message };
const show = actions_AlertActionCreatorsDefault.show;
actions_AlertActionCreatorsDefault;
intl = intl2.intl;
show(obj);
}
leaveFrame(frameId) {
const obj = GlobalUtils;
if (obj.isNotNullish(frameId)) {
const obj3 = { type: "FRAME_SET_ORIENTATION_LOCK_STATE", frameId, lockState: null, pictureInPictureLockState: null };
const obj2 = DispatcherDefault;
obj2.dispatch(obj3);
2026-08-07 06:50:47 +00:00
}
2026-10-03 08:58:59 +00:00
super.leaveFrame(frameId);
2026-08-07 06:50:47 +00:00
}
2026-07-20 16:05:17 +00:00
}
2026-10-03 08:58:59 +00:00
let closure_5 = FramesNativeManager.prototype;
2026-07-29 08:29:29 +00:00
FramesNativeManager.displayName = "FramesNativeManager";
const framesNativeManager = new FramesNativeManager();
const result = size.fileFinishedImporting("modules/frames/native/FramesNativeManager.tsx");
2026-07-20 16:05:17 +00:00
2026-07-29 08:29:29 +00:00
export default framesNativeManager;