decord/source/modules/voice_calls/native/AudioSessionModeManager.tsx

87 lines
3.4 KiB
TypeScript
Raw Normal View History

// Module ID: 17350
// Function ID: 17351
// Name: AudioSessionModeManager
// Dependencies: [17, 1956, 5435, 4596, 502, 1957, 1908, 2011, 4593, 1895, 1074, 1115, 17351, 7132, 2]
2026-07-20 16:05:17 +00:00
// Module 17350 (AudioSessionModeManager)
import VoicePermissionManager from "VoicePermissionManager" /* 17351 */;
import EmbeddedActivitiesStore from "EmbeddedActivitiesStore" /* 1956 */;
import StageChannelRoleStore from "StageChannelRoleStore" /* 5435 */;
import ApplicationStreamingStore from "ApplicationStreamingStore" /* 4596 */;
import AuthenticationStore from "AuthenticationStore" /* 502 */;
import ChannelStore from "ChannelStore" /* 1957 */;
import MediaEngineStore from "MediaEngineStore" /* 1908 */;
import SelectedChannelStore from "SelectedChannelStore" /* 2011 */;
import VoiceStateStore from "VoiceStateStore" /* 4593 */;
import AppStateStore from "AppStateStore" /* 1895 */;
import AutomaticLifecycleManager from "AutomaticLifecycleManager" /* 7132 */;
2026-07-23 10:11:24 +00:00
require = fn;
2026-07-20 16:05:17 +00:00
function handleAVAudioSessionMode() {
const channel = ChannelStore.getChannel(SelectedChannelStore.getVoiceChannelId());
2026-07-20 16:05:17 +00:00
if (null == channel) {
VIDEO = VoiceEngine.AVAudioSessionMode.DEFAULT;
2026-07-29 08:29:29 +00:00
let obj2 = VoiceEngine;
2026-07-20 16:05:17 +00:00
} else {
let hasVideoResult = ApplicationStreamingStore.getAllActiveStreams().length > 0;
2026-07-20 16:05:17 +00:00
if (!hasVideoResult) {
hasVideoResult = VoiceStateStore.hasVideo(channel.id);
2026-07-20 16:05:17 +00:00
}
if (!hasVideoResult) {
hasVideoResult = MediaEngineStore.isVideoEnabled();
2026-07-20 16:05:17 +00:00
}
if (!hasVideoResult) {
if (null == EmbeddedActivitiesStore.getCurrentEmbeddedActivity()) {
2026-07-20 16:05:17 +00:00
const AVAudioSessionMode = VoiceEngine.AVAudioSessionMode;
if (obj.shouldImmediatelyRequestVoicePermissions(AuthenticationStore.getId(), channel.id)) {
2026-07-29 08:29:29 +00:00
VIDEO = AVAudioSessionMode.VOICE;
obj2 = tmp9;
} else {
VIDEO = AVAudioSessionMode.LISTEN;
obj2 = tmp9;
}
obj = VoicePermissionManager;
2026-07-20 16:05:17 +00:00
}
}
VIDEO = VoiceEngine.AVAudioSessionMode.VIDEO;
2026-07-29 08:29:29 +00:00
obj2 = VoiceEngine;
2026-07-20 16:05:17 +00:00
}
2026-07-23 10:11:24 +00:00
let tmp12 = VIDEO !== VIDEO;
2026-07-20 16:05:17 +00:00
if (tmp12) {
tmp12 = AppStateStore.getState() === AppStates.ACTIVE;
2026-07-20 16:05:17 +00:00
}
if (tmp12) {
2026-07-29 08:29:29 +00:00
const result = obj2.setAVAudioSessionMode(VIDEO);
2026-07-20 16:05:17 +00:00
}
}
const AppStates = fn(1074).AppStates;
const PlatformUtils = fn(1115);
if (PlatformUtils.isAndroid()) {
let obj2 = {
setAVAudioSessionMode() {
2026-07-20 16:05:17 +00:00
},
AVAudioSessionMode: { VOICE: "AVAudioSessionModeVoiceChat", VIDEO: "AVAudioSessionModeVideoChat", LISTEN: "AVAudioSessionModeSpokenAudio", DEFAULT: "AVAudioSessionModeDefault" }
2026-07-20 16:05:17 +00:00
};
let VoiceEngine = obj2;
2026-07-20 16:05:17 +00:00
} else {
VoiceEngine = fn(17).NativeModules.VoiceEngine;
2026-07-20 16:05:17 +00:00
}
let VIDEO = VoiceEngine.AVAudioSessionMode.VOICE;
const prototype = function AudioSessionModeManager() {
2026-07-29 08:29:29 +00:00
const applyArgumentsResult = HermesBuiltin.applyArguments(new.target, new.target);
const result = new Map().set(ApplicationStreamingStore, handleAVAudioSessionMode);
const result1 = result.set(VoiceStateStore, handleAVAudioSessionMode);
const result2 = result1.set(MediaEngineStore, handleAVAudioSessionMode);
const result3 = result2.set(StageChannelRoleStore, handleAVAudioSessionMode);
applyArgumentsResult.stores = result3.set(EmbeddedActivitiesStore, handleAVAudioSessionMode);
2026-07-29 08:29:29 +00:00
return applyArgumentsResult;
}.prototype;
class prototype extends tmp2 {
}
const prototype1 = new prototype();
const size = fn(2);
let result = size.fileFinishedImporting("modules/voice_calls/native/AudioSessionModeManager.tsx");
2026-07-20 16:05:17 +00:00
export default prototype1;