decord/source/modules/go_live/GoLiveAutoQualityExperiment.tsx

62 lines
2.7 KiB
TypeScript
Raw Normal View History

// Module ID: 10096
// Function ID: 10097
// Name: GoLiveAutoQualityExperiment
// Dependencies: [1235, 4684, 4685, 1435, 504, 510, 4780, 2]
2026-07-29 08:29:29 +00:00
// Exports: getGoLiveAutoQualityExperimentConfig, maybeMigrateToAutoQuality, useGoLiveAutoQualityExperimentConfig
2026-07-20 16:05:17 +00:00
// Module 10096 (GoLiveAutoQualityExperiment)
import Storage3 from "Storage" /* 510 */;
import ApexExperimentStore from "ApexExperimentStore" /* 1235 */;
import ApplicationStreamingSettingsStore from "ApplicationStreamingSettingsStore" /* 4684 */;
import ApexExperiment from "apex/ApexExperiment" /* 1435 */;
2026-07-23 10:11:24 +00:00
require = fn;
const ApplicationStreamPresets = fn(4685).ApplicationStreamPresets;
2026-07-23 10:11:24 +00:00
let obj = { allowAutoQuality: false, defaultAutoQuality: false, migrateAutoQuality: false };
2026-07-29 08:29:29 +00:00
const GoLiveAutoQualityMigrationVersion = "GoLiveAutoQualityMigrationVersion";
const obj2 = { name: "2025-10-go-live-auto-quality", kind: "user", defaultConfig: obj, variations: null };
const obj3 = { 1: null, 2: null };
const obj4 = {};
2026-07-20 16:05:17 +00:00
const merged = Object.assign(obj);
obj4.allowAutoQuality = true;
obj4.migrateAutoQuality = true;
obj3[1] = obj4;
const obj5 = {};
2026-07-20 16:05:17 +00:00
const merged1 = Object.assign(obj);
obj5.allowAutoQuality = true;
obj5.defaultAutoQuality = true;
obj3[2] = obj5;
obj2.variations = obj3;
let closure_6 = ApexExperiment(obj2);
const size = fn(2);
let result = size.fileFinishedImporting("modules/go_live/GoLiveAutoQualityExperiment.tsx");
2026-07-20 16:05:17 +00:00
2026-07-29 08:29:29 +00:00
export const getGoLiveAutoQualityExperimentConfig = function getGoLiveAutoQualityExperimentConfig(location) {
return closure_6.getConfig({ location: location.location });
2026-07-29 08:29:29 +00:00
};
2026-07-20 16:05:17 +00:00
export const useGoLiveAutoQualityExperimentConfig = function useGoLiveAutoQualityExperimentConfig(location) {
2026-07-23 10:11:24 +00:00
location = location.location;
const items = [ApexExperimentStore];
return location(504).useStateFromStores(items, () => config.getConfig({ location }));
2026-07-20 16:05:17 +00:00
};
export const maybeMigrateToAutoQuality = function maybeMigrateToAutoQuality() {
2026-08-24 06:08:38 +00:00
const Storage = Storage3.Storage;
2026-07-29 08:29:29 +00:00
let num = Storage.get(GoLiveAutoQualityMigrationVersion);
if (num == null) {
num = 0;
}
if (closure_6.getConfig({ location: "maybeMigrateToAutoQuality" }).migrateAutoQuality) {
2026-07-29 08:29:29 +00:00
if (tmp4 < 1) {
const state = ApplicationStreamingSettingsStore.getState();
2026-07-20 16:05:17 +00:00
if (state.preset !== ApplicationStreamPresets.PRESET_CUSTOM) {
const obj = { preset: tmp9.PRESET_AUTO, resolution: null, frameRate: null, soundshareEnabled: null, noTrack: true };
({ resolution: obj2.resolution, fps: obj2.frameRate, soundshareEnabled: obj2.soundshareEnabled } = state);
tmp(4780).updateStreamSettings(obj);
const Storage2 = tmp(510).Storage;
2026-07-29 08:29:29 +00:00
const result = Storage2.set(GoLiveAutoQualityMigrationVersion, 1);
const tmpResult = tmp(4780);
2026-07-20 16:05:17 +00:00
}
}
}
};