decord/source/modules/voice_calls/native/AudioSessionModeManager.tsx
github-actions 777dc50a28 chore: update source for alpha 346.3
Skipped 1 file(s) >100MB (GitHub limit): source/__polyfill/04xxx/module_4790.js (118.4 MB)
2026-09-10 19:12:31 +00:00

86 lines
3.4 KiB
TypeScript

// Module ID: 17409
// Function ID: 17410
// Name: AudioSessionModeManager
// Dependencies: [17, 1956, 5471, 4627, 502, 1957, 1908, 2011, 4624, 1895, 1074, 1115, 17410, 7170, 2]
// Module 17409 (AudioSessionModeManager)
import VoicePermissionManager from "VoicePermissionManager" /* 17410 */;
import EmbeddedActivitiesStore from "EmbeddedActivitiesStore" /* 1956 */;
import StageChannelRoleStore from "StageChannelRoleStore" /* 5471 */;
import ApplicationStreamingStore from "ApplicationStreamingStore" /* 4627 */;
import AuthenticationStore from "AuthenticationStore" /* 502 */;
import ChannelStore from "ChannelStore" /* 1957 */;
import MediaEngineStore from "MediaEngineStore" /* 1908 */;
import SelectedChannelStore from "SelectedChannelStore" /* 2011 */;
import VoiceStateStore from "VoiceStateStore" /* 4624 */;
import AppStateStore from "AppStateStore" /* 1895 */;
import AutomaticLifecycleManager from "AutomaticLifecycleManager" /* 7170 */;
require = fn;
function handleAVAudioSessionMode() {
const channel = ChannelStore.getChannel(SelectedChannelStore.getVoiceChannelId());
if (null == channel) {
VIDEO = VoiceEngine.AVAudioSessionMode.DEFAULT;
let obj2 = VoiceEngine;
} else {
let hasVideoResult = ApplicationStreamingStore.getAllActiveStreams().length > 0;
if (!hasVideoResult) {
hasVideoResult = VoiceStateStore.hasVideo(channel.id);
}
if (!hasVideoResult) {
hasVideoResult = MediaEngineStore.isVideoEnabled();
}
if (!hasVideoResult) {
if (null == EmbeddedActivitiesStore.getCurrentEmbeddedActivity()) {
const AVAudioSessionMode = VoiceEngine.AVAudioSessionMode;
if (obj.shouldImmediatelyRequestVoicePermissions(AuthenticationStore.getId(), channel.id)) {
VIDEO = AVAudioSessionMode.VOICE;
obj2 = tmp9;
} else {
VIDEO = AVAudioSessionMode.LISTEN;
obj2 = tmp9;
}
obj = VoicePermissionManager;
}
}
VIDEO = VoiceEngine.AVAudioSessionMode.VIDEO;
obj2 = VoiceEngine;
}
let tmp12 = VIDEO !== VIDEO;
if (tmp12) {
tmp12 = AppStateStore.getState() === AppStates.ACTIVE;
}
if (tmp12) {
const result = obj2.setAVAudioSessionMode(VIDEO);
}
}
const AppStates = fn(1074).AppStates;
const PlatformUtils = fn(1115);
if (PlatformUtils.isAndroid()) {
let obj2 = {
setAVAudioSessionMode() {
},
AVAudioSessionMode: { VOICE: "AVAudioSessionModeVoiceChat", VIDEO: "AVAudioSessionModeVideoChat", LISTEN: "AVAudioSessionModeSpokenAudio", DEFAULT: "AVAudioSessionModeDefault" }
};
let VoiceEngine = obj2;
} else {
VoiceEngine = fn(17).NativeModules.VoiceEngine;
}
let VIDEO = VoiceEngine.AVAudioSessionMode.VOICE;
const prototype = function AudioSessionModeManager() {
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);
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");
export default prototype1;