decord/alpha/source/stores/VoiceChannelSettingsManager.tsx

76 lines
2.7 KiB
TypeScript
Raw Permalink Normal View History

2026-10-13 12:43:34 +00:00
// Module ID: 18271
// Function ID: 18272
// Name: VoiceChannelSettingsManager
2026-10-13 12:43:34 +00:00
// Dependencies: [502, 14630, 2065, 2116, 14631, 1085, 584, 6808, 2]
2026-07-23 10:11:24 +00:00
2026-10-13 12:43:34 +00:00
// Module 18271 (VoiceChannelSettingsManager)
2026-10-03 08:58:59 +00:00
import DispatcherDefault from "Dispatcher" /* 584 */;
import Constants from "Constants" /* 1085 */;
import AuthenticationStore from "AuthenticationStore" /* 502 */;
2026-10-13 12:43:34 +00:00
import BitRateStore from "BitRateStore" /* 14630 */;
2026-10-10 08:08:14 +00:00
import ChannelStore from "ChannelStore" /* 2065 */;
import SelectedChannelStore from "SelectedChannelStore" /* 2116 */;
2026-10-13 12:43:34 +00:00
import VideoQualityModeStore from "VideoQualityModeStore" /* 14631 */;
2026-10-12 06:59:38 +00:00
import AutomaticLifecycleManager from "AutomaticLifecycleManager" /* 6808 */;
2026-10-03 08:58:59 +00:00
import size from "module_2" /* 2 */;
2026-07-20 16:05:17 +00:00
function updateVoiceSettings() {
const voiceChannelId = SelectedChannelStore.getVoiceChannelId();
2026-10-03 08:58:59 +00:00
const obj = SelectedChannelStore;
2026-07-20 16:05:17 +00:00
if (null != voiceChannelId) {
const channel = ChannelStore.getChannel(voiceChannelId);
2026-10-03 08:58:59 +00:00
const tmp5 = null != channel && tmp2 !== channel.bitrate;
2026-07-20 16:05:17 +00:00
if (tmp5) {
const obj3 = { type: "SET_CHANNEL_BITRATE", bitrate: channel.bitrate };
2026-10-03 08:58:59 +00:00
const obj2 = DispatcherDefault;
obj2.dispatch(obj3);
2026-07-20 16:05:17 +00:00
}
}
2026-10-03 08:58:59 +00:00
const voiceChannelId1 = obj.getVoiceChannelId();
2026-07-20 16:05:17 +00:00
if (null != voiceChannelId1) {
const channel1 = ChannelStore.getChannel(voiceChannelId1);
2026-07-20 16:05:17 +00:00
if (null != channel1) {
let AUTO = channel1.videoQualityMode;
2026-07-29 08:29:29 +00:00
if (AUTO == null) {
2026-07-20 16:05:17 +00:00
AUTO = VideoQualityMode.AUTO;
}
if (tmp10 !== AUTO) {
const obj5 = { type: "SET_CHANNEL_VIDEO_QUALITY_MODE", mode: AUTO };
2026-10-03 08:58:59 +00:00
const obj4 = DispatcherDefault;
obj4.dispatch(obj5);
2026-07-20 16:05:17 +00:00
}
}
}
}
2026-07-29 08:29:29 +00:00
function handleChannelUpdates(arg0) {
2026-10-03 08:58:59 +00:00
const tmp = arg0.channels[Symbol.iterator]();
2026-07-29 08:29:29 +00:00
while (tmp !== undefined) {
if (SelectedChannelStore.getVoiceChannelId() === tmp2.id) {
2026-07-29 08:29:29 +00:00
let tmp5 = updateVoiceSettings();
}
continue;
2026-07-20 16:05:17 +00:00
}
}
function handleVoiceStateUpdates(voiceStates) {
2026-10-03 08:58:59 +00:00
let sessionId;
2026-07-20 16:05:17 +00:00
voiceStates = voiceStates.voiceStates;
const item = voiceStates.forEach((sessionId) => {
2026-07-29 08:29:29 +00:00
if (sessionId.getSessionId() === sessionId.sessionId) {
updateVoiceSettings();
2026-07-20 16:05:17 +00:00
}
});
}
2026-10-03 08:58:59 +00:00
const VideoQualityMode = Constants.VideoQualityMode;
class VoiceChannelSettingsManager extends AutomaticLifecycleManager {
constructor() {
const applyArgumentsResult = HermesBuiltin.applyArguments(this, new.target);
const obj = { CHANNEL_UPDATES: handleChannelUpdates, VOICE_STATE_UPDATES: handleVoiceStateUpdates };
applyArgumentsResult.actions = obj;
return applyArgumentsResult;
}
2026-07-29 08:29:29 +00:00
}
2026-10-03 08:58:59 +00:00
const voiceChannelSettingsManager = new VoiceChannelSettingsManager();
const result = size.fileFinishedImporting("stores/VoiceChannelSettingsManager.tsx");
2026-07-20 16:05:17 +00:00
2026-10-03 08:58:59 +00:00
export default voiceChannelSettingsManager;