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

80 lines
2.7 KiB
TypeScript
Raw Normal View History

2026-10-07 22:43:51 +00:00
// Module ID: 8978
// Function ID: 8979
// Name: FramesNativeManager
2026-10-07 22:43:51 +00:00
// Dependencies: [17, 8703, 1370, 8979, 8980, 5708, 1126, 1375, 584, 2]
2026-10-07 22:43:51 +00:00
// Module 8978 (FramesNativeManager)
2026-10-01 14:13:23 +00:00
import react_native from "react-native" /* 17 */;
2026-10-07 22:43:51 +00:00
import DispatcherDefault from "Dispatcher" /* 584 */;
import intl2 from "intl" /* 1126 */;
import GlobalUtils from "GlobalUtils" /* 1375 */;
import actions_AlertActionCreatorsDefault from "actions/AlertActionCreators" /* 5708 */;
import react_nativeDefault from "react-native" /* 8979 */;
import FramesStore from "FramesStore" /* 8703 */;
import PlatformUtils from "utils/PlatformUtils" /* 1370 */;
import FramesManager from "FramesManager" /* 8980 */;
2026-10-01 14:13:23 +00:00
import size from "module_2" /* 2 */;
const NativeEventEmitter = react_native.NativeEventEmitter;
let nativeEventEmitter = null;
if (PlatformUtils.isAndroid()) {
2026-10-01 14:13:23 +00:00
let self = this;
const self2 = this;
nativeEventEmitter = new NativeEventEmitter(react_nativeDefault);
}
2026-10-01 14:13:23 +00:00
class FramesNativeManager extends FramesManager {
_initialize() {
2026-10-01 14:13:23 +00:00
const self = this;
super._initialize();
const lifecycleSubscription = this.lifecycleSubscription;
if (lifecycleSubscription != null) {
2026-10-01 14:13:23 +00:00
lifecycleSubscription.remove();
}
2026-10-01 14:13:23 +00:00
let addListenerResult;
2026-10-07 22:43:51 +00:00
const obj = nativeEventEmitter;
2026-10-01 14:13:23 +00:00
if (nativeEventEmitter != null) {
addListenerResult = obj.addListener("onHostDestroy", () => {
2026-10-07 22:43:51 +00:00
const allFrames = FramesStore.getAllFrames();
for (const item10007 of allFrames) {
let leaveFrameResult = self.leaveFrame(item10007.id);
continue;
}
});
}
2026-10-07 22:43:51 +00:00
this.lifecycleSubscription = addListenerResult;
}
_terminate() {
2026-10-01 14:13:23 +00:00
super._terminate();
const lifecycleSubscription = this.lifecycleSubscription;
if (lifecycleSubscription != null) {
2026-10-01 14:13:23 +00:00
lifecycleSubscription.remove();
}
}
2026-10-01 14:13:23 +00:00
showRPCDisconnectErrorUI(reason) {
let code;
let intl;
let message;
({ code, message } = reason);
2026-10-07 22:43:51 +00:00
const obj = { title: intl.formatToPlainString(intl2.t.hbiAO6, { code }), body: message };
2026-10-01 14:13:23 +00:00
const show = actions_AlertActionCreatorsDefault.show;
actions_AlertActionCreatorsDefault;
2026-10-07 22:43:51 +00:00
intl = intl2.intl;
2026-10-01 14:13:23 +00:00
show(obj);
}
leaveFrame(frameId) {
2026-10-07 22:43:51 +00:00
const obj = GlobalUtils;
2026-10-01 14:13:23 +00:00
if (obj.isNotNullish(frameId)) {
const obj3 = { type: "FRAME_SET_ORIENTATION_LOCK_STATE", frameId, lockState: null, pictureInPictureLockState: null };
const obj2 = DispatcherDefault;
obj2.dispatch(obj3);
}
super.leaveFrame(frameId);
}
2026-10-01 14:13:23 +00:00
}
2026-10-07 22:43:51 +00:00
let closure_5 = FramesNativeManager.prototype;
FramesNativeManager.displayName = "FramesNativeManager";
const framesNativeManager = new FramesNativeManager();
const result = size.fileFinishedImporting("modules/frames/native/FramesNativeManager.tsx");
export default framesNativeManager;