66 lines
2.0 KiB
TypeScript
66 lines
2.0 KiB
TypeScript
// Metro module 10750 (f10751).
|
|
import ApexExperimentStore from "../experiments/apex/ApexExperimentStore";
|
|
import ApplicationStreamingSettingsStore from "../../stores/ApplicationStreamingSettingsStore";
|
|
import { ApplicationStreamPresets } from "./StreamSettingsConstants";
|
|
import ApexExperiment from "../experiments/apex/ApexExperiment";
|
|
import { useStateFromStores } from "../../_bundle/Module589";
|
|
import { Storage } from "../../_bundle/Module595";
|
|
import { updateStreamSettings } from "../../actions/StreamActionCreators";
|
|
const defaultConfig = {
|
|
allowAutoQuality: false,
|
|
defaultAutoQuality: false,
|
|
migrateAutoQuality: false
|
|
};
|
|
let c7226_5 = "GoLiveAutoQualityMigrationVersion";
|
|
let c7226_6 = ApexExperiment({
|
|
name: "2025-10-go-live-auto-quality",
|
|
kind: "user",
|
|
defaultConfig,
|
|
variations: {
|
|
1: {
|
|
...defaultConfig,
|
|
allowAutoQuality: true,
|
|
migrateAutoQuality: true
|
|
},
|
|
2: {
|
|
...defaultConfig,
|
|
allowAutoQuality: true,
|
|
defaultAutoQuality: true
|
|
}
|
|
}
|
|
});
|
|
export function getGoLiveAutoQualityExperimentConfig(a0) {
|
|
return c7226_6.getConfig({
|
|
location: a0.location
|
|
});
|
|
}
|
|
export function useGoLiveAutoQualityExperimentConfig({ location: location2 }) {
|
|
return useStateFromStores([ApexExperimentStore], () => c7226_6.getConfig({
|
|
location: location2
|
|
}));
|
|
}
|
|
export function maybeMigrateToAutoQuality() {
|
|
const migrateAutoQuality = c7226_6.getConfig({
|
|
location: "maybeMigrateToAutoQuality"
|
|
}).migrateAutoQuality;
|
|
const r9 = Number;
|
|
let r18 = Storage.get(c7226_5);
|
|
if (r18 == null) {
|
|
r18 = 0;
|
|
}
|
|
const r19 = r9(r18);
|
|
if (migrateAutoQuality && !(r19 >= 1)) {
|
|
const state = ApplicationStreamingSettingsStore.getState();
|
|
if (state.preset !== ApplicationStreamPresets.PRESET_CUSTOM) {
|
|
updateStreamSettings({
|
|
preset: ApplicationStreamPresets.PRESET_AUTO,
|
|
resolution: state.resolution,
|
|
frameRate: state.fps,
|
|
soundshareEnabled: state.soundshareEnabled,
|
|
noTrack: true
|
|
});
|
|
Storage.set(c7226_5, 1);
|
|
}
|
|
}
|
|
}
|