decord/alpha/source/modules/frames/native/FramesNativeManager.tsx
2026-10-08 09:57:35 +00:00

79 lines
2.7 KiB
TypeScript

// Module ID: 11150
// Function ID: 11151
// Name: FramesNativeManager
// Dependencies: [17, 10612, 1382, 10624, 11151, 5298, 1126, 1387, 584, 2]
// Module 11150 (FramesNativeManager)
import react_native from "react-native" /* 17 */;
import DispatcherDefault from "Dispatcher" /* 584 */;
import intl2 from "intl" /* 1126 */;
import GlobalUtils from "GlobalUtils" /* 1387 */;
import actions_AlertActionCreatorsDefault from "actions/AlertActionCreators" /* 5298 */;
import react_nativeDefault from "react-native" /* 10624 */;
import FramesStore from "FramesStore" /* 10612 */;
import PlatformUtils from "utils/PlatformUtils" /* 1382 */;
import FramesManager from "FramesManager" /* 11151 */;
import size from "module_2" /* 2 */;
const NativeEventEmitter = react_native.NativeEventEmitter;
let nativeEventEmitter = null;
if (PlatformUtils.isAndroid()) {
let self = this;
const self2 = this;
nativeEventEmitter = new NativeEventEmitter(react_nativeDefault);
}
class FramesNativeManager extends FramesManager {
_initialize() {
const self = this;
super._initialize();
const lifecycleSubscription = this.lifecycleSubscription;
if (lifecycleSubscription != null) {
lifecycleSubscription.remove();
}
let addListenerResult;
const obj = nativeEventEmitter;
if (nativeEventEmitter != null) {
addListenerResult = obj.addListener("onHostDestroy", () => {
const allFrames = FramesStore.getAllFrames();
for (const item10007 of allFrames) {
let leaveFrameResult = self.leaveFrame(item10007.id);
continue;
}
});
}
this.lifecycleSubscription = addListenerResult;
}
_terminate() {
super._terminate();
const lifecycleSubscription = this.lifecycleSubscription;
if (lifecycleSubscription != null) {
lifecycleSubscription.remove();
}
}
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);
}
super.leaveFrame(frameId);
}
}
let closure_5 = FramesNativeManager.prototype;
FramesNativeManager.displayName = "FramesNativeManager";
const framesNativeManager = new FramesNativeManager();
const result = size.fileFinishedImporting("modules/frames/native/FramesNativeManager.tsx");
export default framesNativeManager;