decord/stable/source/stores/ApplicationStreamingSettingsStore.tsx

106 lines
3.7 KiB
TypeScript
Raw Permalink Normal View History

2026-10-06 22:12:49 +00:00
// Module ID: 4883
// Function ID: 4884
// Name: ApplicationStreamingSettingsStore
2026-10-06 22:12:49 +00:00
// Dependencies: [4884, 4862, 504, 585, 2]
2026-10-06 22:12:49 +00:00
// Module 4883 (ApplicationStreamingSettingsStore)
import get_initializedDefault from "get initialized" /* 504 */;
import DispatcherDefault from "Dispatcher" /* 585 */;
import Constants from "Constants" /* 4862 */;
import StreamSettingsConstants from "StreamSettingsConstants" /* 4884 */;
import size from "module_2" /* 2 */;
2026-10-06 22:12:49 +00:00
let ApplicationStreamFPS;
let ApplicationStreamResolutions;
const ApplicationStreamPresets = StreamSettingsConstants.ApplicationStreamPresets;
({ ApplicationStreamResolutions, ApplicationStreamFPS } = StreamSettingsConstants);
const MediaEngineContextTypes = Constants.MediaEngineContextTypes;
2026-10-06 22:12:49 +00:00
let PRESET_VIDEO = ApplicationStreamPresets.PRESET_VIDEO;
let RESOLUTION_720 = ApplicationStreamResolutions.RESOLUTION_720;
let FPS_30 = ApplicationStreamFPS.FPS_30;
let soundshareEnabled = true;
const PersistedStore = get_initializedDefault.PersistedStore;
class ApplicationStreamingSettingsStore extends PersistedStore {
2026-10-06 22:12:49 +00:00
initialize(preset) {
if (null != preset) {
PRESET_VIDEO = preset.preset;
if (PRESET_VIDEO == null) {
PRESET_VIDEO = ApplicationStreamPresets.PRESET_VIDEO;
}
({ resolution: RESOLUTION_720, fps: FPS_30, soundshareEnabled } = preset);
if (soundshareEnabled == null) {
soundshareEnabled = true;
}
}
}
2026-10-06 22:12:49 +00:00
getState() {
return { preset: PRESET_VIDEO, resolution: RESOLUTION_720, fps: FPS_30, soundshareEnabled };
}
}
const prototype = ApplicationStreamingSettingsStore.prototype;
ApplicationStreamingSettingsStore.displayName = "ApplicationStreamingSettingsStore";
ApplicationStreamingSettingsStore.persistKey = "ApplicationStreamingSettingStore";
2026-10-06 22:12:49 +00:00
const obj = {
MEDIA_ENGINE_SET_GO_LIVE_SOURCE: function handleSetGoLiveSource(settings) {
settings = settings.settings;
let context;
if (settings != null) {
context = settings.context;
}
if (context === MediaEngineContextTypes.STREAM) {
let qualityOptions;
if (settings != null) {
qualityOptions = settings.qualityOptions;
}
if (null != qualityOptions) {
let flag = false;
2026-10-06 22:12:49 +00:00
if (PRESET_VIDEO !== settings.qualityOptions.preset) {
PRESET_VIDEO = settings.qualityOptions.preset;
flag = true;
}
2026-10-06 22:12:49 +00:00
if (RESOLUTION_720 !== settings.qualityOptions.resolution) {
RESOLUTION_720 = settings.qualityOptions.resolution;
flag = true;
}
2026-10-06 22:12:49 +00:00
if (FPS_30 !== settings.qualityOptions.frameRate) {
FPS_30 = settings.qualityOptions.frameRate;
flag = true;
}
return flag;
}
}
return false;
},
STREAM_UPDATE_SETTINGS: function handleUpdateSettings(arg0) {
2026-10-06 22:12:49 +00:00
let frameRate;
let preset;
let resolution;
({ preset, resolution, frameRate, soundshareEnabled } = arg0);
let flag = false;
2026-10-06 22:12:49 +00:00
const tmp = null != preset && preset !== PRESET_VIDEO;
if (tmp) {
2026-10-06 22:12:49 +00:00
PRESET_VIDEO = preset;
flag = true;
}
2026-10-06 22:12:49 +00:00
const tmp3 = null != resolution && resolution !== RESOLUTION_720;
if (tmp3) {
2026-10-06 22:12:49 +00:00
RESOLUTION_720 = resolution;
flag = true;
}
2026-10-06 22:12:49 +00:00
const tmp5 = null != frameRate && frameRate !== FPS_30;
if (tmp5) {
2026-10-06 22:12:49 +00:00
FPS_30 = frameRate;
flag = true;
}
2026-10-06 22:12:49 +00:00
const tmp7 = null != soundshareEnabled && soundshareEnabled !== soundshareEnabled;
if (tmp7) {
flag = true;
}
return flag;
}
2026-10-06 22:12:49 +00:00
};
const applicationStreamingSettingsStore = new ApplicationStreamingSettingsStore(DispatcherDefault, obj);
const result = size.fileFinishedImporting("stores/ApplicationStreamingSettingsStore.tsx");
export default applicationStreamingSettingsStore;