This commit is contained in:
janisslsm committed 2026-11-01 12:12:55 +02:00
1 parent 1781d25a15
commit 732c0ad767
33051 files changed
+2591613 -3019689

No files matched your search

@@ -0,0 +1,325 @@
// Metro module 16694 (f16695).
import ApplicationStreamingStore from "../../stores/ApplicationStreamingStore";
import AuthenticationStore from "../../stores/AuthenticationStore";
import ChannelStore from "../../stores/ChannelStore";
import GuildMemberCountStore from "../../stores/GuildMemberCountStore";
import RTCRegionStore from "../../stores/RTCRegionStore";
import SelectedChannelStore from "../../stores/SelectedChannelStore";
import StreamRTCConnectionStore from "../../stores/StreamRTCConnectionStore";
import "../../stores/UserStore";
import { GO_LIVE_NOTIFY_FRIENDS_MIN_MEMBER_COUNT, STREAM_NOTIFY_GUILD_MAX_SIZE } from "./Constants";
import { ApplicationStreamDeleteReasons, ApplicationStreamStates } from "../../Constants";
import { debounce } from "../../_bundle/Module12";
import { changeStreamRegion, notifyStreamStart, stopStream, watchStream, closeStream } from "../../actions/StreamActionCreators";
import Durations from "../../utils/Durations";
import { decodeStreamKey, encodeStreamKey } from "./utils/StreamKeyUtils";
import { Timeout } from "../../_bundle/Timeout";
import AutomaticLifecycleManager from "../../lib/AutomaticLifecycleManager";
import { reportAVError, AVError } from "../errors/av_errors/AVError";
import { getStreamErrorContext } from "../errors/av_errors/AVErrorContext";
function $mk100327($env) {
return () => {
const r1 = $env.$parent;
(0, r1[1])(r1[2][15]).dispatch({
type: "STREAM_TIMED_OUT",
streamKey: $env[0]
});
};
}
let c12028_12, c12028_13, c12028_14, c12028_15, c12028_16, c12028_18, c12028_20;
let $mk100326 = function() {
return (a0) => {
if (!ApplicationStreamingStore.isStreamMarkedFull(a0)) {
c12028_18.delete(a0);
}
};
};
let env12028 = {};
const updateRegion = function updateRegion(a0, a1) {
const r5 = a1 == null ? RTCRegionStore.getPreferredRegion() : a1;
if (r5 != null && r5 !== RTCRegionStore.getRegion(StreamRTCConnectionStore.getHostname(a0))) {
changeStreamRegion(a0, r5);
}
};
GO_LIVE_NOTIFY_FRIENDS_MIN_MEMBER_COUNT;
STREAM_NOTIFY_GUILD_MAX_SIZE;
debounce(notifyStreamStart, 1000);
c12028_12 = {};
c12028_13 = {};
c12028_14 = 3 * Durations.Millis.MINUTE;
c12028_15 = 5 * Durations.Millis.SECOND;
c12028_16 = 12 * Durations.Millis.SECOND;
env12028[17] = null;
c12028_18 = new Set();
class BaseApplicationStreamingManager extends AutomaticLifecycleManager {
handleStreamWatch = ({ streamKey, allowMultiple }) => {
const channel = ChannelStore.getChannel(decodeStreamKey(streamKey).channelId);
const r11 = channel == null ? void 0 : channel.isGuildStageVoice();
let env28495;
const r24 = env28495 = {
$parent: env12028
};
env28495[0] = streamKey;
if (!StreamRTCConnectionStore.getAllActiveStreamKeys().includes(streamKey)) {
let r31 = c12028_13[streamKey];
if (r31 == null) {
r31 = new Timeout();
}
c12028_13[streamKey] = r31;
r31.start.call(r31, r11 ? c12028_16 : c12028_15, $mk100327(r24));
}
const r42 = c12028_12[streamKey];
if (r42 != null) {
r42.stop();
}
delete c12028_12[streamKey];
if (!allowMultiple) {
ApplicationStreamingStore.getAllActiveStreams().forEach((item) => {
const r10 = encodeStreamKey(item);
if (item.ownerId !== AuthenticationStore.getId() && r10 !== streamKey) {
stopStream(r10, false);
}
});
}
};
handleStreamStart = (a0) => {
const { channelId, streamType, guildId } = a0;
const r7 = env12028;
const channel = ChannelStore.getChannel(channelId);
const r23 = encodeStreamKey({
streamType,
guildId,
channelId,
ownerId: AuthenticationStore.getId()
});
const r24 = channel == null ? void 0 : channel.isGuildStageVoice();
let env28496;
const r26 = env28496 = {
$parent: r7
};
env28496[0] = r23;
if (!StreamRTCConnectionStore.getAllActiveStreamKeys().includes(r23)) {
let r33 = c12028_13[r23];
if (r33 == null) {
r33 = new Timeout();
}
c12028_13[r23] = r33;
r33.start.call(r33, r24 ? c12028_16 : c12028_15, $mk100327(r26));
}
this.platformHandleStreamStart(a0);
};
handleStreamCreate = ({ streamKey: streamKey2 }) => {
const r5 = c12028_13[streamKey2];
if (r5 != null) {
r5.stop();
}
delete c12028_13[streamKey2];
c12028_18.forEach($mk100326());
const r19 = decodeStreamKey(streamKey2);
r19.ownerId;
GuildMemberCountStore.getMemberCount(r19.guildId);
};
handleStreamUpdate = ({ streamKey: streamKey2 }) => {
const r5 = c12028_13[streamKey2];
if (r5 != null) {
r5.stop();
}
delete c12028_13[streamKey2];
c12028_18.forEach($mk100326());
};
handleStreamDelete = ({ reason, streamKey: streamKey2 }) => {
const r6 = c12028_13[streamKey2];
if (r6 != null) {
r6.stop();
}
delete c12028_13[streamKey2];
if (reason === ApplicationStreamDeleteReasons.STREAM_FULL) {
reportAVError({
type: AVError.STREAM_FULL,
...getStreamErrorContext(streamKey2)
});
if (!c12028_18.has(streamKey2)) {
c12028_18.add(streamKey2);
this.platformShowStreamFull();
}
}
};
handleStreamClose = ({ streamKey: streamKey2 }) => {
const r6 = c12028_12[streamKey2];
if (r6 != null) {
r6.stop();
}
delete c12028_12[streamKey2];
const r10 = c12028_13[streamKey2];
if (r10 != null) {
r10.stop();
}
delete c12028_13[streamKey2];
};
handleVoiceChannelSelect = (a0) => {
L11: {
const channelId = a0.channelId;
if (channelId != null) {
env12028[17] = null;
c12028_18.forEach($mk100326());
const r15 = ApplicationStreamingStore.getAllApplicationStreamsForChannel(channelId).find((item) => item.ownerId !== AuthenticationStore.getId() && !ApplicationStreamingStore.isStreamMarkedFull(encodeStreamKey(item)));
if (r15 != null) {
const ownerId = r15.ownerId;
if (SelectedChannelStore.getVoiceChannelId() === channelId) {
const channel = ChannelStore.getChannel(channelId);
if (channel != null) {
if (!channel.isDM() && !channel.isGuildStageVoice()) {
break L11;
}
if (ApplicationStreamingStore.getActiveStreamForUser(ownerId, channel.getGuildId()) == null) {
const streamForUser = ApplicationStreamingStore.getStreamForUser(ownerId, channel.getGuildId());
if (streamForUser != null) {
const r40 = encodeStreamKey(streamForUser);
if (r40 !== env12028[17] && !ApplicationStreamingStore.isStreamMarkedFull(r40)) {
env12028[17] = r40;
watchStream(streamForUser, {
noFocus: true
});
}
}
}
}
}
}
}
}
};
handleVoiceStateUpdates = (a0) => {
a0.voiceStates.forEach((voiceState) => {
let r36;
const { userId, channelId, guildId, selfStream } = voiceState;
this.platformHandleVoiceStateUpdate(voiceState);
if (userId !== AuthenticationStore.getId()) {
if ((selfStream ? channelId == null : !selfStream) && c12028_18.size > 0) {
c12028_18.forEach($mk100326());
}
if (channelId != null) {
if (selfStream) {
L20: {
const voiceChannelId = SelectedChannelStore.getVoiceChannelId();
r36 = false;
if (voiceChannelId === channelId) {
const channel = ChannelStore.getChannel(channelId);
const r3 = channel == null;
r36 = false;
if (!r3) {
if (!channel.isDM()) {
const isGuildStageVoice = channel.isGuildStageVoice();
r36 = false;
if (!isGuildStageVoice) {
break L20;
}
}
const r48 = ApplicationStreamingStore.getActiveStreamForUser(userId, channel.getGuildId()) != null;
r36 = false;
if (!r48) {
const streamForUser = ApplicationStreamingStore.getStreamForUser(userId, channel.getGuildId());
const r52 = streamForUser == null;
r36 = false;
if (!r52) {
const r57 = encodeStreamKey(streamForUser);
let r59 = r57 !== env12028[17];
if (r59) {
const isStreamMarkedFull = ApplicationStreamingStore.isStreamMarkedFull(r57);
let r2 = !isStreamMarkedFull;
if (!isStreamMarkedFull) {
env12028[17] = r57;
watchStream(streamForUser, {
noFocus: true
});
r2 = true;
}
r59 = r2;
}
r36 = r59;
}
}
}
}
}
if (r36) {
return void 0;
}
}
const activeStreamForUser = ApplicationStreamingStore.getActiveStreamForUser(userId, guildId);
if (activeStreamForUser != null && activeStreamForUser.channelId === channelId) {
if (!selfStream && activeStreamForUser.state !== ApplicationStreamStates.ENDED) {
const r80 = encodeStreamKey(activeStreamForUser);
let c31100_0 = r80;
let r82 = c12028_12[r80];
if (r82 == null) {
r82 = new Timeout();
}
r82.start(c12028_14, () => closeStream(c31100_0, false));
c12028_12[r80] = r82;
}
if (selfStream && activeStreamForUser.state === ApplicationStreamStates.ENDED) {
const r101 = encodeStreamKey(activeStreamForUser);
const r103 = c12028_12[r101];
if (r103 != null) {
r103.stop();
}
delete c12028_12[r101];
const streamForUser2 = ApplicationStreamingStore.getStreamForUser(userId, guildId);
if (streamForUser2 == null) {
return void 0;
}
if (ApplicationStreamingStore.isStreamMarkedFull(encodeStreamKey(streamForUser2))) {
return void 0;
}
watchStream(streamForUser2);
}
}
}
}
});
};
handleCallUpdate = (a0) => {
const channelId = a0.channelId;
let region = a0.region;
const currentUserActiveStream = ApplicationStreamingStore.getCurrentUserActiveStream();
if (currentUserActiveStream?.channelId === channelId) {
const r17 = encodeStreamKey(currentUserActiveStream);
if (region == null) {
region = RTCRegionStore.getPreferredRegion();
}
if (region != null && region !== RTCRegionStore.getRegion(StreamRTCConnectionStore.getHostname(r17))) {
changeStreamRegion(r17, region);
}
}
};
handleChannelUpdates = ({ channels }) => {
const currentUserActiveStream = ApplicationStreamingStore.getCurrentUserActiveStream();
if (currentUserActiveStream != null) {
for (const item of channels) {
if (currentUserActiveStream.channelId === item.id) {
updateRegion(encodeStreamKey(currentUserActiveStream), item.rtcRegion);
}
}
}
};
handleSessionReset = () => {
c12028_18.clear();
};
actions = {
STREAM_WATCH: this.handleStreamWatch,
STREAM_START: this.handleStreamStart,
STREAM_CREATE: this.handleStreamCreate,
STREAM_UPDATE: this.handleStreamUpdate,
STREAM_DELETE: this.handleStreamDelete,
STREAM_CLOSE: this.handleStreamClose,
CALL_UPDATE: this.handleCallUpdate,
CHANNEL_UPDATES: this.handleChannelUpdates,
VOICE_CHANNEL_SELECT: this.handleVoiceChannelSelect,
VOICE_STATE_UPDATES: this.handleVoiceStateUpdates,
CONNECTION_CLOSED: this.handleSessionReset,
LOGOUT: this.handleSessionReset
};
}
c12028_20 = BaseApplicationStreamingManager;
export default BaseApplicationStreamingManager;
+37
View File
@@ -0,0 +1,37 @@
// Metro module 4254 (f4255).
import { Notifications } from "../../_bundle/Module4255";
const r16 = {
BLACK_SCREEN: "BLACK_SCREEN",
BLURRY: "BLURRY",
LAGGING: "LAGGING",
OUT_OF_SYNC: "OUT_OF_SYNC",
AUDIO_MISSING: "AUDIO_MISSING",
AUDIO_POOR: "AUDIO_POOR",
GAME_ISSUE: "GAME_ISSUE",
STREAM_STOPPED: "STREAM_STOPPED",
NO_ISSUE: "NO_ISSUE",
OTHER: "OTHER",
VIBES_OFF: "VIBES_OFF"
};
const r28 = {
GUILD: "guild",
CALL: "call"
};
const StreamNotificationsGuildMaxSize = Notifications.StreamNotificationsGuildMaxSize;
const set = new Set(["chrome.exe", "opera.exe", "firefox.exe", "brave.exe", "msedge.exe"]);
export { r16 as StreamIssueReportReasons };
export const DARWIN_SOUNDSHARE_VERSION = ">=19.0.0";
export const DARWIN_SCKIT_VERSION = ">=22.0.0";
export const DARWIN_SCKIT_AUDIO_VERSION = ">=22.0.0";
export const DARWIN_SCKIT_SINGLE_TYPE_VERSION = ">=24.0.0";
export const WINDOWS_SOUNDSHARE_NONHOOK_VERSION = ">=10.0.17763";
export const WINDOWS_SOUNDSHARE_HOOK_VERSION = "<10.0.22000";
export const WINDOWS_GRAPHICS_CAPTURE_NEW_APIS_SEMVER = ">=10.0.26100";
export const WINDOWS_SETTINGS_SOUND_DEVICE_DEEPLINK_SEMVER = ">=10.0.26100";
export const WINDOWS_GRAPHICS_CAPTURE_NEW_APIS_BUILD = 26100;
export const WINDOWS_GRAPHICS_CAPTURE_SEMVER = ">=10.0.22000";
export const WINDOWS_GRAPHICS_CAPTURE_BUILD = 22000;
export { r28 as StreamTypes };
export { StreamNotificationsGuildMaxSize as STREAM_NOTIFY_GUILD_MAX_SIZE };
export const GO_LIVE_NOTIFY_FRIENDS_MIN_MEMBER_COUNT = 30;
export { set as BROWSER_EXECUTABLES };
@@ -0,0 +1,65 @@
// 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);
}
}
}
@@ -0,0 +1,12 @@
// Metro module 14457 (f14458).
import { AnalyticEvents } from "../../Constants";
import { NotificationSettingsUpdateType } from "../notifications/NotificationConstants";
import { StreamNotificationsEnabled } from "../user_settings/UserSettings";
import AnalyticsUtils from "../../utils/AnalyticsUtils";
export function onGoLiveNotificationSettingsChanged(a0) {
StreamNotificationsEnabled.updateSetting(a0);
AnalyticsUtils.track(AnalyticEvents.NOTIFICATION_SETTINGS_UPDATED, {
update_type: NotificationSettingsUpdateType.ACCOUNT,
go_live_notifications: a0
});
}
+112
View File
@@ -0,0 +1,112 @@
// Metro module 12864 (f12865).
import TypedEventEmitter from "../../_bundle/TypedEventEmitter";
import Logger from "../debug/Logger";
import { DelayedCall } from "../../_bundle/Timeout";
let c8869_3 = {
RequestedSSRCsUpdate: "requested-ssrcs-update",
RequestedStreamsUpdate: "requested-streams-update"
};
class GoLiveQualityManager extends TypedEventEmitter {
constructor() {
super();
let c20269_0 = this;
this.streamId = null;
this.resolutionWidth = 0;
this.resolutionHeight = 0;
this.zoom = 1;
this.audioSSRC = 0;
this.incomingVideoEnabled = true;
this.delayedUpdate = () => {
c20269_0.delayedCall.delay();
};
this.logger = new Logger("GoLiveQualityManager");
this.logger.enableNativeLogger(true);
this.delayedCall = new DelayedCall(500, () => {
this.update();
});
}
setUserID(a0) {
this.userId = a0;
}
getUserID() {
return this.userId;
}
updateAudioAndVideoStreamInfo(a0, a1) {
this.audioSSRC = a0;
this.videoStream = a1.find((item) => item.active);
this.update();
}
onIncomingVideoEnabled(a0) {
if (this.incomingVideoEnabled !== a0) {
this.logger.info("onIncomingVideoEnabled", a0);
this.incomingVideoEnabled = a0;
this.update();
}
}
update() {
if (this.userId != null && this.videoStream != null) {
if (this.incomingVideoEnabled) {
this.requestStream();
} else {
this.stopStream();
}
}
}
requestStream() {
if (this.videoStream != null) {
const request2 = this.request;
const r3 = {};
r3[this.videoStream.ssrc] = 100;
request2.call(this, r3, [this.videoStream.ssrc]);
}
}
stopStream() {
if (this.videoStream != null) {
const request2 = this.request;
const r3 = {};
r3[this.videoStream.ssrc] = 0;
request2.call(this, r3, []);
}
}
request(a0, a1) {
let c20270_0;
if (this.userId !== void 0) {
c20270_0 = a0;
a1.forEach((item) => {
if (c20270_0.pixelCounts == null) {
c20270_0.pixelCounts = {};
}
if (c20270_0[item] > 0) {
const pixelCounts = c20270_0.pixelCounts;
const r6 = Math;
pixelCounts[item] = r6.floor(this.resolutionWidth * this.resolutionHeight * this.zoom * this.zoom);
}
});
this.emit(c8869_3.RequestedSSRCsUpdate, this.userId, this.audioSSRC, a1);
this.emit(c8869_3.RequestedStreamsUpdate, a0);
}
}
setVideoSize(a0, a1, a2) {
if (this.streamId === a0) {
if (a1 != null) {
this.resolutionWidth = a1.width;
this.resolutionHeight = a1.height;
}
if (a2 != null) {
this.zoom = a2;
}
this.delayedUpdate();
}
}
setStreamId(a0) {
if (this.streamId !== a0) {
this.streamId = a0;
this.resolutionWidth = 0;
this.resolutionHeight = 0;
this.zoom = 1;
this.delayedUpdate();
}
}
}
export default GoLiveQualityManager;
export { c8869_3 as GoLiveQualityManagerEvent };
@@ -0,0 +1,18 @@
// Metro module 10748 (f10749).
import { ApplicationStreamResolutions } from "./StreamSettingsConstants";
import ApexExperiment from "../experiments/apex/ApexExperiment";
const defaultConfig = {
videoPresetResolutionMax: ApplicationStreamResolutions.RESOLUTION_1440
};
const r26 = ApexExperiment({
name: "2026-02-go-live-video-preset-resolution",
kind: "user",
defaultConfig,
variations: {
1: {
...defaultConfig,
videoPresetResolutionMax: ApplicationStreamResolutions.RESOLUTION_1080
}
}
});
export default r26;
@@ -0,0 +1,132 @@
// Metro module 2093 (f2094).
import { loadJsonAsset } from "../asset_json/native/AssetJsonUtils";
import * as _Module2094 from "../../_bundle/Module2094";
import * as _Module2095 from "../../_bundle/Module2095";
import * as _Module2096 from "../../_bundle/Module2096";
import * as _Module2097 from "../../_bundle/Module2097";
import * as _Module2098 from "../../_bundle/Module2098";
import * as _Module2099 from "../../_bundle/Module2099";
import * as _Module2100 from "../../_bundle/Module2100";
import * as _Module2101 from "../../_bundle/Module2101";
import * as _Module2102 from "../../_bundle/Module2102";
import * as _Module2103 from "../../_bundle/Module2103";
import * as _Module2104 from "../../_bundle/Module2104";
import * as _Module2105 from "../../_bundle/Module2105";
import * as _Module2106 from "../../_bundle/Module2106";
import * as _Module2107 from "../../_bundle/Module2107";
import * as _Module2108 from "../../_bundle/Module2108";
import * as _Module2109 from "../../_bundle/Module2109";
import * as _Module2110 from "../../_bundle/Module2110";
import * as _Module2111 from "../../_bundle/Module2111";
import * as _Module2112 from "../../_bundle/Module2112";
import * as _Module2113 from "../../_bundle/Module2113";
import * as _Module2114 from "../../_bundle/Module2114";
import * as _Module2115 from "../../_bundle/Module2115";
import * as _Module2116 from "../../_bundle/Module2116";
import * as _Module2117 from "../../_bundle/Module2117";
import * as _Module2118 from "../../_bundle/Module2118";
import * as _Module2119 from "../../_bundle/Module2119";
import * as _Module2120 from "../../_bundle/Module2120";
import * as _Module2121 from "../../_bundle/Module2121";
import * as _Module2122 from "../../_bundle/Module2122";
import * as _Module2123 from "../../_bundle/Module2123";
import * as _Module2124 from "../../_bundle/Module2124";
import { createLoader, makeMessagesProxy } from "../../_bundle/Module1274";
const loader = createLoader({
bg: () => loadJsonAsset(_Module2094).then((result) => ({
default: result
})),
cs: () => loadJsonAsset(_Module2095).then((result) => ({
default: result
})),
da: () => loadJsonAsset(_Module2096).then((result) => ({
default: result
})),
de: () => loadJsonAsset(_Module2097).then((result) => ({
default: result
})),
el: () => loadJsonAsset(_Module2098).then((result) => ({
default: result
})),
"en-GB": () => loadJsonAsset(_Module2099).then((result) => ({
default: result
})),
"es-419": () => loadJsonAsset(_Module2100).then((result) => ({
default: result
})),
"es-ES": () => loadJsonAsset(_Module2101).then((result) => ({
default: result
})),
fi: () => loadJsonAsset(_Module2102).then((result) => ({
default: result
})),
fr: () => loadJsonAsset(_Module2103).then((result) => ({
default: result
})),
hi: () => loadJsonAsset(_Module2104).then((result) => ({
default: result
})),
hr: () => loadJsonAsset(_Module2105).then((result) => ({
default: result
})),
hu: () => loadJsonAsset(_Module2106).then((result) => ({
default: result
})),
it: () => loadJsonAsset(_Module2107).then((result) => ({
default: result
})),
ja: () => loadJsonAsset(_Module2108).then((result) => ({
default: result
})),
ko: () => loadJsonAsset(_Module2109).then((result) => ({
default: result
})),
lt: () => loadJsonAsset(_Module2110).then((result) => ({
default: result
})),
nl: () => loadJsonAsset(_Module2111).then((result) => ({
default: result
})),
no: () => loadJsonAsset(_Module2112).then((result) => ({
default: result
})),
pl: () => loadJsonAsset(_Module2113).then((result) => ({
default: result
})),
"pt-BR": () => loadJsonAsset(_Module2114).then((result) => ({
default: result
})),
ro: () => loadJsonAsset(_Module2115).then((result) => ({
default: result
})),
ru: () => loadJsonAsset(_Module2116).then((result) => ({
default: result
})),
"sv-SE": () => loadJsonAsset(_Module2117).then((result) => ({
default: result
})),
th: () => loadJsonAsset(_Module2118).then((result) => ({
default: result
})),
tr: () => loadJsonAsset(_Module2119).then((result) => ({
default: result
})),
uk: () => loadJsonAsset(_Module2120).then((result) => ({
default: result
})),
vi: () => loadJsonAsset(_Module2121).then((result) => ({
default: result
})),
"zh-CN": () => loadJsonAsset(_Module2122).then((result) => ({
default: result
})),
"zh-TW": () => loadJsonAsset(_Module2123).then((result) => ({
default: result
})),
"en-US": () => loadJsonAsset(_Module2124).then((result) => ({
default: result
}))
}, "en-US");
const r51 = makeMessagesProxy(loader);
export default r51;
export { loader as messagesLoader };
@@ -0,0 +1,27 @@
// Metro module 15927 (f15928).
import { createApexExperiment } from "../experiments/apex/index";
const r15 = {
CONTROL: 0,
0: "CONTROL",
SCREENSHARE_REPLACES_CHAT: 1,
1: "SCREENSHARE_REPLACES_CHAT",
SCREENSHARE_REPLACES_SOUNDBOARD: 2,
2: "SCREENSHARE_REPLACES_SOUNDBOARD"
};
const variations = {};
variations[r15.SCREENSHARE_REPLACES_CHAT] = {
treatment: r15.SCREENSHARE_REPLACES_CHAT
};
variations[r15.SCREENSHARE_REPLACES_SOUNDBOARD] = {
treatment: r15.SCREENSHARE_REPLACES_SOUNDBOARD
};
const apexExperiment = createApexExperiment({
name: "2026-01-mobile-go-live-entrypoint",
kind: "user",
defaultConfig: {
treatment: r15.CONTROL
},
variations
});
export default apexExperiment;
export { r15 as MobileGoLiveEntrypointTreatment };
+675
View File
@@ -0,0 +1,675 @@
// Metro module 4278 (f4279).
import ClipsStore from "../clips/ClipsStore";
import { getSystemAnalyticsInfo } from "../system_analytics/SystemAnalyticsStore.native";
import ApplicationStreamingSettingsStore from "../../stores/ApplicationStreamingSettingsStore";
import AuthenticationStore from "../../stores/AuthenticationStore";
import ChannelStore from "../../stores/ChannelStore";
import HookErrorStore from "../../stores/HookErrorStore";
import MediaEngineStore from "../../stores/MediaEngineStore";
import NetworkStore from "../../stores/NetworkStore";
import RTCConnectionStore from "../../stores/RTCConnectionStore";
import RTCRegionStore from "../../stores/RTCRegionStore";
import { AnalyticEvents, MediaEngineHookTypes, RTCConnectionStates } from "../../Constants";
import { MediaEngineContextTypes } from "../../_bundle/Module4250";
import Durations from "../../utils/Durations";
import RTCConnection from "../../lib/RTCConnection";
import SoundshareStatsAggregator from "../../lib/SoundshareStatsAggregator";
import { Timeout } from "../../_bundle/Timeout";
import { decodeStreamKey } from "./utils/StreamKeyUtils";
import VideoStreamStats from "./VideoStreamStats";
import Module12 from "../../_bundle/Module12";
import Dispatcher from "../../Dispatcher";
import { RTCConnectionEvent } from "../../lib/RTCConnectionEvent";
import { BaseConnectionEvent } from "../../_bundle/Module4286";
import { getRunningGameAnalytics } from "../game_detection/GameAnalyticsUtils";
import AnalyticsUtils from "../../utils/AnalyticsUtils";
import CrossPlatformNativeUtils_native from "../../utils/CrossPlatformNativeUtils.native";
import getSoundshareAnalyticsContext from "./utils/getSoundshareAnalyticsContext";
import { now } from "../../_bundle/sleep";
import getStreamSourceMetadata_native from "./utils/getStreamSourceMetadata.native";
import * as _VoiceEngineStreamingManager from "./native/VoiceEngineStreamingManager";
import { isClipsEnabled } from "../clips/isClipsEnabled";
import getMediaPerformanceClass_android from "../device/getMediaPerformanceClass.android";
import { HermesBuiltin } from "../../_hermes/prelude";
let prototype, StreamRTCConnection;
let c2517_17 = 5 * Durations.Millis.SECOND;
let c2517_18 = {
DETACHED: 0,
0: "DETACHED",
WAITING: 1,
1: "WAITING",
ATTACHED: 2,
2: "ATTACHED",
STARTED: 3,
3: "STARTED",
PLAYING: 4,
4: "PLAYING",
SILENCE: 5,
5: "SILENCE"
};
const StreamRTCConnection2 = class StreamRTCConnection extends RTCConnection {
constructor({ sessionId, streamKey, serverId, initialLayout, analyticsContext, parentMediaSessionId, channelId }) {
const streamContext = decodeStreamKey(streamKey);
const { guildId, channelId: channelId2 } = streamContext;
const r31 = {
userId: AuthenticationStore.getId(),
sessionId,
guildId,
channelId: channelId2,
context: MediaEngineContextTypes.STREAM,
streamServerId: serverId,
streamChannelId: channelId,
parentMediaSessionId,
joinVoiceId: null
};
super(r31);
this.soundshareStats = new SoundshareStatsAggregator();
this._firstFrameDelivered = false;
this.screenshareFinishedCount = 0;
this.soundshareFailuresReported = {};
this.errorTimer = new Timeout();
this.streamContext = streamContext;
this.streamKey = streamKey;
this.videoStreamStats = new VideoStreamStats(initialLayout, this.isOwner);
this.analyticsContext = analyticsContext;
this.updateVideoStreamId = Module12.debounce((a0, a1) => {
const r13 = decodeStreamKey(this.streamKey);
Dispatcher.dispatch({
type: "RTC_CONNECTION_VIDEO",
guildId: r13.guildId,
channelId: r13.channelId,
userId: r13.ownerId,
streamId: a0,
rtcServerId: a1,
mediaEngineConnectionId: this.getMediaEngineConnectionId(),
context: MediaEngineContextTypes.STREAM
});
}, 200);
this.videoStreamStats.start();
this.initializeEvents();
}
get isOwner() {
const ownerId = this.streamContext.ownerId;
return AuthenticationStore.getId() === ownerId;
}
destroy(a0) {
this.videoStreamStats.stop();
this.trackVideoEndStats(a0);
this.updateVideoStreamId.cancel();
this.updateVideoStreamId(null, null);
this.updateVideoStreamId.flush();
this.errorTimer.stop();
Reflect.get(Object.getPrototypeOf(prototype), "destroy", this).call(this);
}
streamUpdate(a0) {
const _videoQuality2 = this._videoQuality;
if (_videoQuality2 != null) {
if (a0) {
_videoQuality2.pause();
} else {
_videoQuality2.resume();
}
}
}
layoutChange(a0) {
this.videoStreamStats.layoutChange(a0);
}
autoQualityChange() {
this.videoStreamStats.autoQualityChange();
}
getVideoStats() {
let r7;
const ownerId = this.streamContext.ownerId;
const _videoQuality2 = this._videoQuality;
if (_videoQuality2 != null) {
if (this.isOwner) {
let r10 = _videoQuality2.getOutboundStats()[0];
if (r10 == null) {
r10 = {};
}
r7 = r10;
} else {
r7 = _videoQuality2.getInboundStats(ownerId);
if (r7 == null) {
r7 = {};
}
}
return {
duration: r7.duration,
avg_bitrate: r7.avg_bitrate,
avg_fps: r7.avg_fps,
avg_resolution: r7.avg_resolution,
inbound_bitrate_estimate_percentile99: r7.inbound_bitrate_estimate_percentile99
};
}
return null;
}
getRegion() {
return this.analyticsContext.streamRegion;
}
getMaxViewers() {
return this.analyticsContext.maxViewers;
}
getVoiceParticipantType() {
return this.isOwner ? "streamer" : "receiver";
}
initializeEvents() {
let c14082_0 = false;
this.on(RTCConnectionEvent.State, (a0, a1, a2) => {
Dispatcher.dispatch({
type: "RTC_CONNECTION_STATE",
state: a0,
...a1,
...a2,
streamKey: this.streamKey
});
if (a0 === RTCConnectionStates.RTC_CONNECTED) {
const _connection = this._connection;
if (_connection != null) {
_connection.on(BaseConnectionEvent.ScreenshareFinish, (screenshare_frames, videohook_frames, hybrid_dxgi_frames, hybrid_gdi_frames, hybrid_videohook_frames, hybrid_graphics_capture_frames, hybrid_capture_method_switches, hybrid_gdi_bitblt_frames, hybrid_gdi_printwindow_frames, hybrid_graphics_capture_frames_unique, hybrid_dxgi_frames_unique, hybrid_videohook_frames_unique, hybrid_gdi_bitblt_frames_unique, hybrid_gdi_printwindow_frames_unique, skip_history_json, quartz_frames, desktop_capturer_type, activity, go_live_camera_frames, screencapturekit_frames, hdr_frames_capable, hdr_frames, target_window_elevated, pipewire_frames, x11_frames, videohook_backend) => {
const streamApplicationFromHistory = this.analyticsContext.getStreamApplicationFromHistory(this.screenshareFinishedCount);
this.screenshareFinishedCount = this.screenshareFinishedCount + 1;
const runningGameAnalytics = getRunningGameAnalytics(streamApplicationFromHistory);
const { gameName, gameId, exe, distributor } = runningGameAnalytics;
const mediaSessionId = this.getMediaSessionId();
const rTCConnectionId = this.getRTCConnectionId();
getSystemAnalyticsInfo().then((result) => {
const r7 = result != null ? {
cpu_brand: result.cpu_brand,
cpu_vendor: result.cpu_vendor,
cpu_memory: result.cpu_memory,
gpu_brand: result.gpu_brand,
gpu_memory: result.gpu_memory
} : null;
const SCREENSHARE_FINISHED = AnalyticEvents.SCREENSHARE_FINISHED;
let r25 = screenshare_frames;
let r9 = videohook_frames;
let r24 = hybrid_dxgi_frames;
let r23 = hybrid_gdi_frames;
let r22 = hybrid_videohook_frames;
let r21 = hybrid_graphics_capture_frames;
let r18 = hybrid_graphics_capture_frames_unique;
let r14 = hybrid_dxgi_frames_unique;
let r17 = hybrid_videohook_frames_unique;
let r16 = hybrid_gdi_bitblt_frames_unique;
let r15 = hybrid_gdi_printwindow_frames_unique;
let r20 = quartz_frames;
let r19 = screencapturekit_frames;
let r40 = go_live_camera_frames;
if (screenshare_frames == null) {
r25 = 0;
}
if (videohook_frames == null) {
r9 = 0;
}
const r42 = r25 + r9;
if (hybrid_dxgi_frames == null) {
r24 = 0;
}
const r43 = r42 + r24;
if (hybrid_gdi_frames == null) {
r23 = 0;
}
const r44 = r43 + r23;
if (hybrid_videohook_frames == null) {
r22 = 0;
}
const r45 = r44 + r22;
if (hybrid_graphics_capture_frames == null) {
r21 = 0;
}
const r46 = r45 + r21;
if (quartz_frames == null) {
r20 = 0;
}
const r47 = r46 + r20;
if (screencapturekit_frames == null) {
r19 = 0;
}
const r48 = r47 + r19;
if (go_live_camera_frames == null) {
r40 = 0;
}
const r52 = r48 + r40 + (x11_frames == null ? 0 : x11_frames);
const r54 = pipewire_frames == null ? 0 : pipewire_frames;
if (hybrid_graphics_capture_frames_unique == null) {
r18 = 0;
}
if (hybrid_dxgi_frames_unique == null) {
r14 = 0;
}
const r56 = r18 + r14;
if (hybrid_videohook_frames_unique == null) {
r17 = 0;
}
const r57 = r56 + r17;
if (hybrid_gdi_bitblt_frames_unique == null) {
r16 = 0;
}
const r58 = r57 + r16;
if (hybrid_gdi_printwindow_frames_unique == null) {
r15 = 0;
}
AnalyticsUtils.track(SCREENSHARE_FINISHED, {
screenshare_frames,
videohook_frames,
hybrid_dxgi_frames,
hybrid_gdi_frames,
hybrid_videohook_frames,
hybrid_graphics_capture_frames,
hybrid_capture_method_switches,
hybrid_gdi_bitblt_frames,
hybrid_gdi_printwindow_frames,
hybrid_graphics_capture_frames_unique,
hybrid_dxgi_frames_unique,
hybrid_videohook_frames_unique,
hybrid_gdi_bitblt_frames_unique,
hybrid_gdi_printwindow_frames_unique,
skip_history_json,
quartz_frames,
screencapturekit_frames,
go_live_camera_frames,
total_frames: r52 + r54,
total_frames_unique: r58 + r15,
desktop_capturer_type,
media_session_id: mediaSessionId,
rtc_connection_id: rTCConnectionId,
context: MediaEngineContextTypes.STREAM,
activity,
soundshare_session: this.soundshareStats.getStats().soundshare_last_session,
picker_type_used: this.analyticsContext.nativePickerStyleUsed != null ? "native" : "internal",
duration: this.analyticsContext.getDuration(),
share_game_name: gameName,
share_game_id: gameId,
share_game_exe: exe,
share_game_distributor: distributor,
hdr_frames_capable,
hdr_frames,
discord_is_elevated: CrossPlatformNativeUtils_native.getDiscordIsElevated(),
target_window_elevated,
pipewire_frames,
x11_frames,
videohook_backend,
...r7
});
});
});
}
const _connection2 = this._connection;
if (_connection2 != null) {
_connection2.on(BaseConnectionEvent.SoundshareAttached, () => {
const goLiveSource = MediaEngineStore.getGoLiveSource();
if (goLiveSource?.desktopSource != null) {
AnalyticsUtils.track(AnalyticEvents.SOUNDSHARE_ATTACHED, {
...getSoundshareAnalyticsContext(goLiveSource?.desktopSource),
...this.getSoundshareAnalyticsProperties()
});
}
});
}
const _connection3 = this._connection;
if (_connection3 != null) {
_connection3.on(BaseConnectionEvent.SoundshareFailed, ({ failureCode, failureReason, willRetry }) => {
this.reportSoundshareFailure(MediaEngineStore.getGoLiveSource()?.desktopSource, failureCode, failureReason, willRetry);
});
}
const _connection4 = this._connection;
if (_connection4 != null) {
_connection4.on(BaseConnectionEvent.SoundshareSpeaking, () => {
const goLiveSource = MediaEngineStore.getGoLiveSource();
if (goLiveSource?.desktopSource != null) {
AnalyticsUtils.track(AnalyticEvents.SOUNDSHARE_TRANSMITTING, {
...getSoundshareAnalyticsContext(goLiveSource?.desktopSource),
...this.getSoundshareAnalyticsProperties()
});
if (HookErrorStore.getHookError(MediaEngineHookTypes.SOUND) != null) {
Dispatcher.dispatch({
type: "MEDIA_ENGINE_SOUNDSHARE_TRANSMITTING"
});
}
}
});
}
const _connection5 = this._connection;
if (_connection5 != null) {
_connection5.on(BaseConnectionEvent.SoundshareTrace, (a0) => {
const goLiveSource = MediaEngineStore.getGoLiveSource();
this.soundshareStats.traceEvent(goLiveSource == null ? void 0 : goLiveSource.desktopSource?.soundshareSession, a0);
const type2 = a0.type;
if (type2 === "soundshare_attach_requested") {
this.errorTimer.start(c2517_17, () => {
Dispatcher.dispatch({
type: "MEDIA_ENGINE_SOUNDSHARE_FAILED",
errorMessage: "Sound Hook Failed"
});
});
} else if (type2 === "soundshare_recv_failed") {
const { reason: reason2, code, retry } = a0;
if (goLiveSource?.desktopSource != null) {
this.reportSoundshareFailure(goLiveSource?.desktopSource, code, reason2, retry);
if (!retry) {
this.errorTimer.stop();
Dispatcher.dispatch({
type: "MEDIA_ENGINE_SOUNDSHARE_FAILED",
errorMessage: reason2,
errorCode: code
});
}
}
} else if (type2 === "soundshare_state_transition" && a0.newState === c2517_18.PLAYING) {
this.errorTimer.stop();
Dispatcher.dispatch({
type: "MEDIA_ENGINE_SOUNDSHARE_TRANSMITTING"
});
}
});
}
const _connection6 = this._connection;
if (_connection6 != null) {
_connection6.on(BaseConnectionEvent.FirstFrameStats, (a0) => {
if (!this._firstFrameDelivered) {
this._firstFrameDelivered = true;
const streamAnalyticsProperties = this.getStreamAnalyticsProperties();
AnalyticsUtils.track(AnalyticEvents.RECEIVER_FIRST_FRAME_DELIVERED, {
guild_id: streamAnalyticsProperties.guild_id,
channel_id: streamAnalyticsProperties.channel_id,
rtc_connection_id: streamAnalyticsProperties.rtc_connection_id,
media_session_id: streamAnalyticsProperties.media_session_id,
parent_media_session_id: streamAnalyticsProperties.parent_media_session_id,
num_viewers: this.analyticsContext.numViewers,
time_connected_to_first_frame_delivered: this.getDuration(),
time_total_to_first_frame: now() - this.getCreatedTime(),
time_remote_user_to_video_stream_created: a0.remoteVideoStreamCreatedTimestamp !== void 0 ? a0.remoteUserCreatedTimestamp !== void 0 ? Number(a0.remoteVideoStreamCreatedTimestamp - a0.remoteUserCreatedTimestamp) : null : null,
time_video_stream_created_to_video_data_received: a0.videoDataReceivedTimestamp !== void 0 ? a0.remoteVideoStreamCreatedTimestamp !== void 0 ? Number(a0.videoDataReceivedTimestamp - a0.remoteVideoStreamCreatedTimestamp) : null : null,
time_video_data_received_to_video_source_delivered_frame: a0.videoSourceDeliveredFrameTimestamp !== void 0 ? a0.videoDataReceivedTimestamp !== void 0 ? Number(a0.videoSourceDeliveredFrameTimestamp - a0.videoDataReceivedTimestamp) : null : null,
time_remote_user_to_mls_external_sender_updated: a0.updateMLSExternalSenderTimestamp !== void 0 ? a0.remoteUserCreatedTimestamp !== void 0 ? Number(a0.updateMLSExternalSenderTimestamp - a0.remoteUserCreatedTimestamp) : null : null,
time_remote_user_to_secure_frame_remote_key_ratchet_set: a0.setRemoteSecureFrameKeyRatchetTimestamp !== void 0 ? a0.remoteUserCreatedTimestamp !== void 0 ? Number(a0.setRemoteSecureFrameKeyRatchetTimestamp - a0.remoteUserCreatedTimestamp) : null : null,
time_remote_user_to_secure_frame_local_key_ratchet_set: a0.setLocalSecureFrameKeyRatchetTimestamp !== void 0 ? a0.remoteUserCreatedTimestamp !== void 0 ? Number(a0.setLocalSecureFrameKeyRatchetTimestamp - a0.remoteUserCreatedTimestamp) : null : null,
time_remote_user_to_first_frame_decrypted: a0.firstFrameDecryptedTimestamp !== void 0 ? a0.remoteUserCreatedTimestamp !== void 0 ? Number(a0.firstFrameDecryptedTimestamp - a0.remoteUserCreatedTimestamp) : null : null
});
}
});
}
const _connection7 = this._connection;
if (_connection7 != null) {
_connection7.on(BaseConnectionEvent.FirstFrameEncryptedStats, (a0) => {
const streamAnalyticsProperties = this.getStreamAnalyticsProperties();
AnalyticsUtils.track(AnalyticEvents.STREAMER_FIRST_FRAME_ENCRYPTED, {
guild_id: streamAnalyticsProperties.guild_id,
channel_id: streamAnalyticsProperties.channel_id,
rtc_connection_id: streamAnalyticsProperties.rtc_connection_id,
media_session_id: streamAnalyticsProperties.media_session_id,
parent_media_session_id: streamAnalyticsProperties.parent_media_session_id,
time_local_user_to_video_receivers_set: a0.videoReceiversSetTimestamp !== void 0 ? a0.localUserCreatedTimestamp !== void 0 ? Number(a0.videoReceiversSetTimestamp - a0.localUserCreatedTimestamp) : null : null,
time_local_user_to_mls_external_sender_updated: a0.updateMLSExternalSenderTimestamp !== void 0 ? a0.localUserCreatedTimestamp !== void 0 ? Number(a0.updateMLSExternalSenderTimestamp - a0.localUserCreatedTimestamp) : null : null,
time_local_user_to_secure_frame_remote_key_ratchet_set: a0.setRemoteSecureFrameKeyRatchetTimestamp !== void 0 ? a0.localUserCreatedTimestamp !== void 0 ? Number(a0.setRemoteSecureFrameKeyRatchetTimestamp - a0.localUserCreatedTimestamp) : null : null,
time_local_user_to_secure_frame_local_key_ratchet_set: a0.setLocalSecureFrameKeyRatchetTimestamp !== void 0 ? a0.localUserCreatedTimestamp !== void 0 ? Number(a0.setLocalSecureFrameKeyRatchetTimestamp - a0.localUserCreatedTimestamp) : null : null,
time_local_user_to_first_frame_encrypted: a0.firstFrameEncryptedTimestamp !== void 0 ? a0.localUserCreatedTimestamp !== void 0 ? Number(a0.firstFrameEncryptedTimestamp - a0.localUserCreatedTimestamp) : null : null
});
});
}
const _connection8 = this._connection;
if (_connection8 != null) {
_connection8.on(BaseConnectionEvent.Destroy, () => {
this.errorTimer.stop();
});
}
}
});
this.on(RTCConnectionEvent.Video, (a0, a1, a2, a3, a4) => {
const r12 = decodeStreamKey(this.streamKey);
if (r12.guildId === a0 && r12.channelId === a1 && r12.ownerId === a2) {
if (!(this.getMediaSessionId() == null || c14082_0)) {
this.trackVideoStartStats();
c14082_0 = true;
}
this.updateVideoStreamId(a3, a4);
}
});
this.on(RTCConnectionEvent.VideoSourceQualityChanged, (a0, a1, a2, a3, a4, a5) => {
Dispatcher.dispatch({
type: "MEDIA_ENGINE_VIDEO_SOURCE_QUALITY_CHANGED",
guildId: a0,
channelId: a1,
senderUserId: a2,
maxResolution: a3,
maxFrameRate: a4,
context: a5
});
});
this.on(RTCConnectionEvent.SecureFramesUpdate, () => {
Dispatcher.dispatch({
type: "RTC_CONNECTION_SECURE_FRAMES_UPDATE"
});
});
this.on(RTCConnectionEvent.RosterMapUpdate, (a0) => {
Dispatcher.dispatch({
type: "RTC_CONNECTION_ROSTER_MAP_UPDATE",
userIds: a0
});
});
}
reportSoundshareFailure(a0, a1, a2, a3) {
let r5 = a0?.soundshareSession;
if (r5 == null) {
r5 = "";
}
if (this.soundshareFailuresReported[r5] == null) {
this.soundshareFailuresReported[r5] = new Set();
}
const r23 = a1 != null && !this.soundshareFailuresReported[r5].has(a1);
if (r23) {
this.soundshareFailuresReported[r5].add(a1);
}
if (a1 == null || r23) {
AnalyticsUtils.track(AnalyticEvents.SOUNDSHARE_FAILED, {
soundshare_failure_code: a1,
soundshare_failure_reason: a2,
soundshare_failure_will_retry: a3,
...getSoundshareAnalyticsContext(a0),
...this.getSoundshareAnalyticsProperties()
});
}
}
getStreamAnalyticsProperties() {
const analyticsContext = this.analyticsContext;
const { streamRegion, streamApplication, streamSourceType, actionContext } = analyticsContext;
const streamContext = this.streamContext;
const { ownerId, guildId } = streamContext;
const region = RTCRegionStore.getRegion(RTCConnectionStore.getHostname());
const runningGameAnalytics = getRunningGameAnalytics(streamApplication);
const { gameName: gameName2, gameId: gameId2, exe: exe2, distributor: distributor2, sku, gameMetadata } = runningGameAnalytics;
return {
channel_id: this.channelId,
rtc_connection_id: this.getRTCConnectionId(),
media_session_id: this.getMediaSessionId(),
parent_media_session_id: this.parentMediaSessionId,
sender_user_id: ownerId,
context: MediaEngineContextTypes.STREAM,
guild_id: guildId,
stream_region: streamRegion,
stream_source_type: streamSourceType,
guild_region: region,
participant_type: this.isOwner ? "streamer" : "receiver",
share_application_name: gameName2,
share_application_id: gameId2,
share_application_executable: exe2,
share_application_distributor: distributor2,
share_application_distributor_game_id: sku,
share_application_game_metadata: gameMetadata,
video_layout: this.videoStreamStats.getLayout(),
client_event_source: actionContext,
voice_backend_version: this.voiceVersion,
rtc_worker_backend_version: this.rtcWorkerVersion
};
}
getSoundshareAnalyticsProperties() {
return {
rtc_connection_id: this.getRTCConnectionId(),
soundshare_experimental: MediaEngineStore.getExperimentalSoundshare()
};
}
trackVideoStartStats() {
const r7 = this.isOwner ? getStreamSourceMetadata_native() : null;
AnalyticsUtils.track(AnalyticEvents.VIDEO_STREAM_STARTED, {
...this.getStreamAnalyticsProperties(),
...r7,
connection_type: NetworkStore.getType(),
effective_connection_speed: NetworkStore.getEffectiveConnectionSpeed(),
service_provider: NetworkStore.getServiceProvider(),
duration_go_live_modal: this.analyticsContext.goLiveModalDurationMs,
source_location_stack: this.analyticsContext.analyticsLocations
});
}
trackVideoEndStats(reason) {
let c14083_0, networkStats, codecUsageStats, c14083_6, c14083_7;
const channel = ChannelStore.getChannel(this.channelId);
const type = channel != null ? channel.type : null;
const ownerId = this.streamContext.ownerId;
const _videoQuality = this._videoQuality;
if (_videoQuality != null) {
networkStats = _videoQuality.getNetworkStats();
const isOwner2 = this.isOwner;
const getCodecUsageStats = _videoQuality.getCodecUsageStats;
codecUsageStats = isOwner2 ? getCodecUsageStats.call(_videoQuality, "streamer", this.userId) : getCodecUsageStats.call(_videoQuality, "receiver", ownerId);
c14083_6 = {
stream_application_name: _VoiceEngineStreamingManager.default.getApplicationNames()
};
const settings = ClipsStore.getSettings();
c14083_7 = this.isOwner ? {
clips_enabled: isClipsEnabled(),
clips_buffer_length: settings.clipsLength
} : {};
c14083_0 = this.isOwner ? {
bandwidth_estimation_experiment: this.getBandwidthEstimationExperiment()
} : {};
_videoQuality.getOutboundStats().forEach((item) => {
let num_frames = item.num_frames;
if (num_frames == null) {
num_frames = 0;
}
if (num_frames > 0) {
const VIDEO_STREAM_ENDED = AnalyticEvents.VIDEO_STREAM_ENDED;
const r19 = {
...codecUsageStats,
...networkStats,
...c14083_6
};
HermesBuiltin.copyDataProperties(r19, this.videoStreamStats.getStats());
HermesBuiltin.copyDataProperties(r19, item);
HermesBuiltin.copyDataProperties(r19, this.soundshareStats.getStats());
HermesBuiltin.copyDataProperties(r19, this.getStreamAnalyticsProperties());
HermesBuiltin.copyDataProperties(r19, c14083_7);
HermesBuiltin.copyDataProperties(r19, c14083_0);
r19.app_hardware_acceleration_enabled = CrossPlatformNativeUtils_native.getAppHardwareAccelerationEnabled();
r19.channel_type = type;
r19.reason = reason;
r19.max_viewers = this.analyticsContext.maxViewers;
r19.hostname = this.hostname;
r19.hardware_enabled = MediaEngineStore.getHardwareEncoding();
r19.device_performance_class = this.isOwner ? getMediaPerformanceClass_android() : null;
r19.soundshare_experimental = MediaEngineStore.getExperimentalSoundshare();
r19.quality_preset = ApplicationStreamingSettingsStore.getState().preset;
r19.discord_is_elevated = CrossPlatformNativeUtils_native.getDiscordIsElevated();
AnalyticsUtils.track(VIDEO_STREAM_ENDED, r19);
}
});
_videoQuality.getInboundParticipants().forEach((item) => {
const inboundStats = _videoQuality.getInboundStats(item);
let r18 = inboundStats?.num_frames;
if (r18 == null) {
r18 = 0;
}
if (r18 > 0) {
const VIDEO_STREAM_ENDED = AnalyticEvents.VIDEO_STREAM_ENDED;
const r23 = {
...codecUsageStats,
...networkStats,
...c14083_6
};
HermesBuiltin.copyDataProperties(r23, this.videoStreamStats.getStats());
HermesBuiltin.copyDataProperties(r23, inboundStats);
HermesBuiltin.copyDataProperties(r23, this.soundshareStats.getStats());
HermesBuiltin.copyDataProperties(r23, this.getStreamAnalyticsProperties());
HermesBuiltin.copyDataProperties(r23, c14083_7);
HermesBuiltin.copyDataProperties(r23, c14083_0);
r23.app_hardware_acceleration_enabled = CrossPlatformNativeUtils_native.getAppHardwareAccelerationEnabled();
r23.channel_type = type;
r23.reason = reason;
r23.max_viewers = this.analyticsContext.maxViewers;
r23.hostname = this.hostname;
r23.hardware_enabled = MediaEngineStore.getHardwareEncoding();
r23.device_performance_class = this.isOwner ? getMediaPerformanceClass_android() : null;
AnalyticsUtils.track(VIDEO_STREAM_ENDED, r23);
}
});
}
}
getExtraConnectionOptions() {
return {
streamUserId: decodeStreamKey(this.streamKey).ownerId
};
}
getMediaStreamKey() {
return this.streamKey;
}
};
const prototype2 = StreamRTCConnection2.prototype;
StreamRTCConnection = StreamRTCConnection2;
prototype = prototype2;
export default StreamRTCConnection;
export class StreamRTCAnalyticsContext {
constructor(a0) {
const { streamRegion, streamApplication, streamSourceType, actionContext, numViewers, goLiveModalDurationMs } = a0;
let analyticsLocations = a0.analyticsLocations;
this.streamRegion = streamRegion;
this.streamApplication = streamApplication;
this.streamApplicationHistory = [streamApplication];
this.streamSourceType = streamSourceType;
this.actionContext = actionContext;
this.maxViewers = numViewers;
this.goLiveModalDurationMs = goLiveModalDurationMs;
this.numViewers = numViewers;
if (analyticsLocations == null) {
analyticsLocations = [];
}
this.analyticsLocations = analyticsLocations;
}
setActionContext(a0) {
this.actionContext = a0;
}
updateStreamApplication(a0) {
this.streamApplication = a0;
this.streamApplicationHistory = [...this.streamApplicationHistory, a0];
}
setAnalyticsLocations(a0) {
this.analyticsLocations = a0;
}
trackViewerCount(a0) {
this.maxViewers = Math.max(a0, this.maxViewers);
this.numViewers = a0;
}
setNativePickerStyleUsed(a0) {
this.nativePickerStyleUsed = a0;
}
trackStart() {
this.startTime = performance.now();
}
trackEnd() {
this.endTime = performance.now();
}
getStreamApplicationFromHistory(a0) {
return this.streamApplicationHistory[a0];
}
getDuration() {
if (this.startTime == null) {
return null;
}
const r6 = performance.now();
let endTime = this.endTime;
if (endTime == null) {
endTime = r6;
}
return endTime - this.startTime;
}
}
+571
View File
@@ -0,0 +1,571 @@
// Metro module 4244 (f4245).
import { BoostedGuildTiers } from "../../Constants";
import { StreamQualities } from "../premium/PremiumConstants";
import { intl, t } from "../../intl/index.native";
function $mk74013($env) {
return function() {
const r1 = $env;
const r2 = r1[1];
return r2 != null ? r2() : String(r1[0]);
};
}
function $mk74014() {
return function() {};
}
let c2471_1, c2472_1, c2473_1, RESOLUTION_7202, c2475_1, RESOLUTION_10802, c2476_1, RESOLUTION_14402, c2477_1, RESOLUTION_480, c2478_1, RESOLUTION_7203, c2479_1, RESOLUTION_10803, c2480_1, RESOLUTION_14403, c2481_1, RESOLUTION_SOURCE2, c2482_1, FPS_15, c2483_1, FPS_30, c2484_1, FPS_60, c2485_1, FPS_152, c2486_1, FPS_302, c2487_1, FPS_602, c2488_1;
let env2471;
let env2472;
let env2473;
let env2474;
let env2475;
let env2476;
let env2477;
let env2478;
let env2479;
let env2480;
let env2481;
let env2482;
let env2483;
let env2484;
let env2485;
let env2486;
let env2487;
let env2488;
let c2470_2 = {
RESOLUTION_480: 480,
480: "RESOLUTION_480",
RESOLUTION_720: 720,
720: "RESOLUTION_720",
RESOLUTION_1080: 1080,
1080: "RESOLUTION_1080",
RESOLUTION_1440: 1440,
1440: "RESOLUTION_1440",
RESOLUTION_SOURCE: 0,
0: "RESOLUTION_SOURCE"
};
let c2470_3 = {
FPS_5: 5,
5: "FPS_5",
FPS_15: 15,
15: "FPS_15",
FPS_30: 30,
30: "FPS_30",
FPS_60: 60,
60: "FPS_60"
};
const r11 = {
PRESET_VIDEO: 1,
1: "PRESET_VIDEO",
PRESET_DOCUMENTS: 2,
2: "PRESET_DOCUMENTS",
PRESET_CUSTOM: 3,
3: "PRESET_CUSTOM",
PRESET_AUTO: 4,
4: "PRESET_AUTO",
PRESET_MOBILE_DEFAULT: 5,
5: "PRESET_MOBILE_DEFAULT",
PRESET_MOBILE_PERFORMANCE: 6,
6: "PRESET_MOBILE_PERFORMANCE",
PRESET_MOBILE_HIGH_QUALITY: 7,
7: "PRESET_MOBILE_HIGH_QUALITY"
};
const r10 = [{
resolution: c2470_2.RESOLUTION_SOURCE,
fps: c2470_3.FPS_60,
quality: StreamQualities.HIGH_STREAMING_QUALITY
}, {
resolution: c2470_2.RESOLUTION_SOURCE,
fps: c2470_3.FPS_30,
quality: StreamQualities.HIGH_STREAMING_QUALITY
}, {
resolution: c2470_2.RESOLUTION_SOURCE,
fps: c2470_3.FPS_15,
quality: StreamQualities.HIGH_STREAMING_QUALITY
}, {
resolution: c2470_2.RESOLUTION_SOURCE,
fps: c2470_3.FPS_5,
preset: r11.PRESET_DOCUMENTS
}, {
resolution: c2470_2.RESOLUTION_1440,
fps: c2470_3.FPS_60,
guildPremiumTier: BoostedGuildTiers.TIER_2,
quality: StreamQualities.MID_STREAMING_QUALITY
}, {
resolution: c2470_2.RESOLUTION_1440,
fps: c2470_3.FPS_30,
guildPremiumTier: BoostedGuildTiers.TIER_2,
quality: StreamQualities.MID_STREAMING_QUALITY
}, {
resolution: c2470_2.RESOLUTION_1440,
fps: c2470_3.FPS_15,
guildPremiumTier: BoostedGuildTiers.TIER_2,
quality: StreamQualities.MID_STREAMING_QUALITY
}, {
resolution: c2470_2.RESOLUTION_1080,
fps: c2470_3.FPS_60,
guildPremiumTier: BoostedGuildTiers.TIER_2,
quality: StreamQualities.MID_STREAMING_QUALITY
}, {
resolution: c2470_2.RESOLUTION_1080,
fps: c2470_3.FPS_30,
guildPremiumTier: BoostedGuildTiers.TIER_2,
quality: StreamQualities.MID_STREAMING_QUALITY
}, {
resolution: c2470_2.RESOLUTION_1080,
fps: c2470_3.FPS_15,
guildPremiumTier: BoostedGuildTiers.TIER_2,
quality: StreamQualities.MID_STREAMING_QUALITY
}, {
resolution: c2470_2.RESOLUTION_720,
fps: c2470_3.FPS_60,
guildPremiumTier: BoostedGuildTiers.TIER_1,
quality: StreamQualities.MID_STREAMING_QUALITY
}, {
resolution: c2470_2.RESOLUTION_720,
fps: c2470_3.FPS_30
}, {
resolution: c2470_2.RESOLUTION_720,
fps: c2470_3.FPS_15
}, {
resolution: c2470_2.RESOLUTION_720,
fps: c2470_3.FPS_5
}, {
resolution: c2470_2.RESOLUTION_480,
fps: c2470_3.FPS_60,
guildPremiumTier: BoostedGuildTiers.TIER_1,
quality: StreamQualities.MID_STREAMING_QUALITY
}, {
resolution: c2470_2.RESOLUTION_480,
fps: c2470_3.FPS_30
}, {
resolution: c2470_2.RESOLUTION_480,
fps: c2470_3.FPS_15
}, {
resolution: c2470_2.RESOLUTION_480,
fps: c2470_3.FPS_5
}];
const RESOLUTION_7205 = c2470_2.RESOLUTION_720;
const r133 = env2471 = {};
const RESOLUTION_720 = RESOLUTION_7205;
c2471_1 = void 0;
const r134 = {
value: RESOLUTION_7205
};
Object.defineProperty(r134, "label", {
get: $mk74013(r133),
set: void 0,
enumerable: true,
configurable: true
});
Object.defineProperty(r134, "subtext", {
get: $mk74014(),
set: void 0,
enumerable: true,
configurable: true
});
const RESOLUTION_10804 = c2470_2.RESOLUTION_1080;
const r138 = env2472 = {};
const RESOLUTION_1080 = RESOLUTION_10804;
c2472_1 = void 0;
const r139 = {
value: RESOLUTION_10804
};
Object.defineProperty(r139, "label", {
get: $mk74013(r138),
set: void 0,
enumerable: true,
configurable: true
});
Object.defineProperty(r139, "subtext", {
get: $mk74014(),
set: void 0,
enumerable: true,
configurable: true
});
const RESOLUTION_14404 = c2470_2.RESOLUTION_1440;
const r143 = env2473 = {};
const RESOLUTION_1440 = RESOLUTION_14404;
c2473_1 = void 0;
const r144 = {
value: RESOLUTION_14404
};
Object.defineProperty(r144, "label", {
get: $mk74013(r143),
set: void 0,
enumerable: true,
configurable: true
});
Object.defineProperty(r144, "subtext", {
get: $mk74014(),
set: void 0,
enumerable: true,
configurable: true
});
const RESOLUTION_SOURCE3 = c2470_2.RESOLUTION_SOURCE;
const r148 = env2474 = {};
const RESOLUTION_SOURCE = RESOLUTION_SOURCE3;
const c2474_1 = () => intl.string(t.XjXqzh);
const r150 = {
value: RESOLUTION_SOURCE3
};
Object.defineProperty(r150, "label", {
get: $mk74013(r148),
set: void 0,
enumerable: true,
configurable: true
});
Object.defineProperty(r150, "subtext", {
get: $mk74014(),
set: void 0,
enumerable: true,
configurable: true
});
const r9 = [r134, r139, r144, r150];
const RESOLUTION_7206 = c2470_2.RESOLUTION_720;
const r154 = env2475 = {};
RESOLUTION_7202 = RESOLUTION_7206;
c2475_1 = void 0;
const r155 = {
value: RESOLUTION_7206
};
Object.defineProperty(r155, "label", {
get: $mk74013(r154),
set: void 0,
enumerable: true,
configurable: true
});
Object.defineProperty(r155, "subtext", {
get: $mk74014(),
set: void 0,
enumerable: true,
configurable: true
});
const RESOLUTION_10805 = c2470_2.RESOLUTION_1080;
const r160 = env2476 = {};
RESOLUTION_10802 = RESOLUTION_10805;
c2476_1 = void 0;
const r161 = {
value: RESOLUTION_10805
};
Object.defineProperty(r161, "label", {
get: $mk74013(r160),
set: void 0,
enumerable: true,
configurable: true
});
Object.defineProperty(r161, "subtext", {
get: $mk74014(),
set: void 0,
enumerable: true,
configurable: true
});
const RESOLUTION_14405 = c2470_2.RESOLUTION_1440;
const r165 = env2477 = {};
RESOLUTION_14402 = RESOLUTION_14405;
c2477_1 = void 0;
const r166 = {
value: RESOLUTION_14405
};
Object.defineProperty(r166, "label", {
get: $mk74013(r165),
set: void 0,
enumerable: true,
configurable: true
});
Object.defineProperty(r166, "subtext", {
get: $mk74014(),
set: void 0,
enumerable: true,
configurable: true
});
const r158 = [r155, r161, r166];
const RESOLUTION_4802 = c2470_2.RESOLUTION_480;
const r170 = env2478 = {};
RESOLUTION_480 = RESOLUTION_4802;
c2478_1 = () => {
const RESOLUTION_4802 = c2470_2.RESOLUTION_480;
return RESOLUTION_4802 === c2470_2.RESOLUTION_SOURCE ? intl.string(t.XjXqzh) : intl.formatToPlainString(t.TEOC0I, {
resolution: RESOLUTION_4802
});
};
const r172 = {
value: RESOLUTION_4802
};
Object.defineProperty(r172, "label", {
get: $mk74013(r170),
set: void 0,
enumerable: true,
configurable: true
});
Object.defineProperty(r172, "subtext", {
get: $mk74014(),
set: void 0,
enumerable: true,
configurable: true
});
const RESOLUTION_7204 = c2470_2.RESOLUTION_720;
const r176 = env2479 = {};
RESOLUTION_7203 = RESOLUTION_7204;
c2479_1 = () => {
const RESOLUTION_7204 = c2470_2.RESOLUTION_720;
return RESOLUTION_7204 === c2470_2.RESOLUTION_SOURCE ? intl.string(t.XjXqzh) : intl.formatToPlainString(t.TEOC0I, {
resolution: RESOLUTION_7204
});
};
const r178 = {
value: RESOLUTION_7204
};
Object.defineProperty(r178, "label", {
get: $mk74013(r176),
set: void 0,
enumerable: true,
configurable: true
});
Object.defineProperty(r178, "subtext", {
get: $mk74014(),
set: void 0,
enumerable: true,
configurable: true
});
const RESOLUTION_10806 = c2470_2.RESOLUTION_1080;
const r182 = env2480 = {};
RESOLUTION_10803 = RESOLUTION_10806;
c2480_1 = () => {
const RESOLUTION_10804 = c2470_2.RESOLUTION_1080;
return RESOLUTION_10804 === c2470_2.RESOLUTION_SOURCE ? intl.string(t.XjXqzh) : intl.formatToPlainString(t.TEOC0I, {
resolution: RESOLUTION_10804
});
};
const r184 = {
value: RESOLUTION_10806
};
Object.defineProperty(r184, "label", {
get: $mk74013(r182),
set: void 0,
enumerable: true,
configurable: true
});
Object.defineProperty(r184, "subtext", {
get: $mk74014(),
set: void 0,
enumerable: true,
configurable: true
});
const RESOLUTION_14406 = c2470_2.RESOLUTION_1440;
const r188 = env2481 = {};
RESOLUTION_14403 = RESOLUTION_14406;
c2481_1 = () => {
const RESOLUTION_14404 = c2470_2.RESOLUTION_1440;
return RESOLUTION_14404 === c2470_2.RESOLUTION_SOURCE ? intl.string(t.XjXqzh) : intl.formatToPlainString(t.TEOC0I, {
resolution: RESOLUTION_14404
});
};
const r190 = {
value: RESOLUTION_14406
};
Object.defineProperty(r190, "label", {
get: $mk74013(r188),
set: void 0,
enumerable: true,
configurable: true
});
Object.defineProperty(r190, "subtext", {
get: $mk74014(),
set: void 0,
enumerable: true,
configurable: true
});
const RESOLUTION_SOURCE4 = c2470_2.RESOLUTION_SOURCE;
const r194 = env2482 = {};
RESOLUTION_SOURCE2 = RESOLUTION_SOURCE4;
c2482_1 = () => {
const RESOLUTION_SOURCE3 = c2470_2.RESOLUTION_SOURCE;
return RESOLUTION_SOURCE3 === c2470_2.RESOLUTION_SOURCE ? intl.string(t.XjXqzh) : intl.formatToPlainString(t.TEOC0I, {
resolution: RESOLUTION_SOURCE3
});
};
const r196 = {
value: RESOLUTION_SOURCE4
};
Object.defineProperty(r196, "label", {
get: $mk74013(r194),
set: void 0,
enumerable: true,
configurable: true
});
Object.defineProperty(r196, "subtext", {
get: $mk74014(),
set: void 0,
enumerable: true,
configurable: true
});
const r175 = [r172, r178, r184, r190, r196];
const FPS_153 = c2470_3.FPS_15;
const r200 = env2483 = {};
FPS_15 = FPS_153;
c2483_1 = void 0;
const r201 = {
value: FPS_153
};
Object.defineProperty(r201, "label", {
get: $mk74013(r200),
set: void 0,
enumerable: true,
configurable: true
});
Object.defineProperty(r201, "subtext", {
get: $mk74014(),
set: void 0,
enumerable: true,
configurable: true
});
const FPS_303 = c2470_3.FPS_30;
const r205 = env2484 = {};
FPS_30 = FPS_303;
c2484_1 = void 0;
const r206 = {
value: FPS_303
};
Object.defineProperty(r206, "label", {
get: $mk74013(r205),
set: void 0,
enumerable: true,
configurable: true
});
Object.defineProperty(r206, "subtext", {
get: $mk74014(),
set: void 0,
enumerable: true,
configurable: true
});
const FPS_603 = c2470_3.FPS_60;
const r210 = env2485 = {};
FPS_60 = FPS_603;
c2485_1 = void 0;
const r211 = {
value: FPS_603
};
Object.defineProperty(r211, "label", {
get: $mk74013(r210),
set: void 0,
enumerable: true,
configurable: true
});
Object.defineProperty(r211, "subtext", {
get: $mk74014(),
set: void 0,
enumerable: true,
configurable: true
});
const r204 = [r201, r206, r211];
const FPS_154 = c2470_3.FPS_15;
const r215 = env2486 = {};
FPS_152 = FPS_154;
c2486_1 = () => intl.formatToPlainString(t["bW+JCW"], {
value: c2470_3.FPS_15
});
const r217 = {
value: FPS_154
};
Object.defineProperty(r217, "label", {
get: $mk74013(r215),
set: void 0,
enumerable: true,
configurable: true
});
Object.defineProperty(r217, "subtext", {
get: $mk74014(),
set: void 0,
enumerable: true,
configurable: true
});
const FPS_304 = c2470_3.FPS_30;
const r221 = env2487 = {};
FPS_302 = FPS_304;
c2487_1 = () => intl.formatToPlainString(t["bW+JCW"], {
value: c2470_3.FPS_30
});
const r223 = {
value: FPS_304
};
Object.defineProperty(r223, "label", {
get: $mk74013(r221),
set: void 0,
enumerable: true,
configurable: true
});
Object.defineProperty(r223, "subtext", {
get: $mk74014(),
set: void 0,
enumerable: true,
configurable: true
});
const FPS_604 = c2470_3.FPS_60;
const r227 = env2488 = {};
FPS_602 = FPS_604;
c2488_1 = () => intl.formatToPlainString(t["bW+JCW"], {
value: c2470_3.FPS_60
});
const r229 = {
value: FPS_604
};
Object.defineProperty(r229, "label", {
get: $mk74013(r227),
set: void 0,
enumerable: true,
configurable: true
});
Object.defineProperty(r229, "subtext", {
get: $mk74014(),
set: void 0,
enumerable: true,
configurable: true
});
const r220 = [r217, r223, r229];
export { c2470_2 as ApplicationStreamResolutions };
export function getApplicationResolution(a0) {
if (c2470_2.RESOLUTION_480 === a0) {
return c2470_2.RESOLUTION_480;
}
if (c2470_2.RESOLUTION_720 === a0) {
return c2470_2.RESOLUTION_720;
}
if (c2470_2.RESOLUTION_1080 === a0) {
return c2470_2.RESOLUTION_1080;
}
if (c2470_2.RESOLUTION_1440 === a0) {
return c2470_2.RESOLUTION_1440;
}
if (c2470_2.RESOLUTION_SOURCE === a0) {
return c2470_2.RESOLUTION_SOURCE;
}
throw new Error(`Unknown resolution: ${a0}`);
}
export { c2470_3 as ApplicationStreamFPS };
export { r11 as ApplicationStreamPresets };
export function getApplicationFramerate(a0) {
if (c2470_3.FPS_5 === a0) {
return c2470_3.FPS_5;
}
if (c2470_3.FPS_15 === a0) {
return c2470_3.FPS_15;
}
if (c2470_3.FPS_30 === a0) {
return c2470_3.FPS_30;
}
if (c2470_3.FPS_60 === a0) {
return c2470_3.FPS_60;
}
throw new Error(`Unknown frame rate: ${a0}`);
}
export { r10 as ApplicationStreamSettingRequirements };
export { r9 as ApplicationStreamResolutionButtons };
export { r158 as GoLiveDeviceResolutionButtons };
export function makeResolutionLabel(a0) {
return a0 === c2470_2.RESOLUTION_SOURCE ? intl.string(t.XjXqzh) : intl.formatToPlainString(t.TEOC0I, {
resolution: a0
});
}
export { r175 as ApplicationStreamResolutionButtonsWithSuffixLabel };
export { r204 as ApplicationStreamFPSButtons };
export { r220 as ApplicationStreamFPSButtonsWithSuffixLabel };
+92
View File
@@ -0,0 +1,92 @@
// Metro module 4284 (f4285).
import ApplicationStreamingSettingsStore from "../../stores/ApplicationStreamingSettingsStore";
import { StreamLayouts } from "../../Constants";
import { Interval } from "../../_bundle/Timeout";
import { now } from "../../_bundle/sleep";
class VideoStreamStats {
_targetResolution = 0;
_targetFPS = 0;
_streamSettingsChanged = false;
_lastLayoutChanged = 0;
_layoutChanges = 0;
_automaticQualityChanges = 0;
_incrementLayout = (a0, a1) => {
if (this._layoutBuckets[a0] == null) {
this._layoutBuckets[a0] = 0;
}
const _layoutBuckets = this._layoutBuckets;
_layoutBuckets[a0] = _layoutBuckets[a0] + a1;
};
_sampleStats = () => {
const state = ApplicationStreamingSettingsStore.getState();
const { resolution, fps } = state;
this._streamSettingsChanged = resolution !== this._targetResolution || fps !== this._targetFPS;
};
constructor(a0, a1) {
this._isSender = a1;
this._statInterval = new Interval();
this._lastLayout = a0;
this._layoutBuckets = {};
}
start() {
const state = ApplicationStreamingSettingsStore.getState();
const { resolution, fps } = state;
this._targetResolution = resolution;
this._targetFPS = fps;
this._statInterval.start(1000, this._sampleStats);
this._lastLayoutChanged = now();
}
stop() {
this._statInterval.stop();
this._streamEnd = now();
this._incrementLayout(this._lastLayout, (this._streamEnd - this._lastLayoutChanged) / 1000);
}
autoQualityChange() {
this._automaticQualityChanges = this._automaticQualityChanges + 1;
}
layoutChange(a0) {
if (a0 !== this._lastLayout && this._streamEnd == null) {
const _lastLayoutChanged = now();
this._incrementLayout(this._lastLayout, (_lastLayoutChanged - this._lastLayoutChanged) / 1000);
this._layoutChanges = this._layoutChanges + 1;
this._lastLayout = a0;
this._lastLayoutChanged = _lastLayoutChanged;
}
}
getLayout() {
return this._lastLayout;
}
getStats() {
const r9 = this._layoutBuckets[StreamLayouts.FULL_SCREEN];
const duration_layout_fullscreen = r9 != null ? Math.round(r9) : 0;
const r18 = this._layoutBuckets[StreamLayouts.THEATRE];
const duration_layout_theatre = r18 != null ? Math.round(r18) : 0;
const r26 = this._layoutBuckets[StreamLayouts.PIP];
const duration_layout_pip = r26 != null ? Math.round(r26) : 0;
const r34 = this._layoutBuckets[StreamLayouts.POPOUT];
const duration_layout_popout = r34 != null ? Math.round(r34) : 0;
const r42 = this._layoutBuckets[StreamLayouts.PORTRAIT];
const duration_layout_portrait = r42 != null ? Math.round(r42) : 0;
const r50 = this._layoutBuckets[StreamLayouts.LANDSCAPE];
const duration_layout_landscape = r50 != null ? Math.round(r50) : 0;
const r58 = this._layoutBuckets[StreamLayouts.MINIMIZED];
const r5 = {
num_layout_changes: this._layoutChanges,
duration_layout_fullscreen,
duration_layout_theatre,
duration_layout_pip,
duration_layout_popout,
duration_layout_portrait,
duration_layout_landscape,
duration_layout_minimized: r58 != null ? Math.round(r58) : 0
};
return this._isSender ? {
...r5,
target_fps: this._targetFPS,
target_resolution_height: this._targetResolution,
stream_settings_changed: this._streamSettingsChanged,
num_auto_quality_changes: this._automaticQualityChanges
} : r5;
}
}
export default VideoStreamStats;
@@ -0,0 +1,47 @@
// Metro module 16693 (f16694).
import ApplicationStreamingSettingsStore from "../../../stores/ApplicationStreamingSettingsStore";
import { ApplicationStreamPresets } from "../StreamSettingsConstants";
import { MediaEngineContextTypes } from "../../../_bundle/Module4250";
import Logger from "../../debug/Logger";
import ApplicationStreamingManager2 from "../ApplicationStreamingManager";
import AlertActionCreators from "../../../actions/native/AlertActionCreators";
import MobileGoLiveUpsellExperiment from "./MobileGoLiveUpsellExperiment";
import AudioActionCreators from "../../../actions/AudioActionCreators";
let c12027_7 = new Logger("ApplicationStreamingManager");
c12027_7.enableNativeLogger(true);
class ApplicationStreamingManager extends ApplicationStreamingManager2 {
platformShowStreamFull() {
AlertActionCreators.openLazy({
importer: () => import("../../../components_native/calls/stream/StreamFullAlert").then(({ default: Component }) => (a0) => <Component {...a0} />)
});
}
platformHandleStreamStart({ sourceId }) {
if (sourceId != null) {
const r27 = MobileGoLiveUpsellExperiment.getConfig({
location: "platformHandleStreamStart"
}).showMobileGoLiveUpsell ? ApplicationStreamingSettingsStore.getState() : {
preset: ApplicationStreamPresets.PRESET_CUSTOM,
resolution: 720,
fps: 30,
soundshareEnabled: true
};
AudioActionCreators.setGoLiveSource({
desktopSettings: {
sourceId,
sound: r27.soundshareEnabled
},
qualityOptions: {
preset: r27.preset,
resolution: r27.resolution,
frameRate: r27.fps
},
context: MediaEngineContextTypes.STREAM
});
} else {
c12027_7.warn(`invalid start_stream: both application + display modes were specified (source-id: ${sourceId})`);
}
}
platformHandleVoiceStateUpdate() {}
}
const applicationStreamingManager = new ApplicationStreamingManager();
export default applicationStreamingManager;
@@ -0,0 +1,271 @@
// Metro module 10746 (f10747).
import { memo, useCallback, useState } from "react";
import ApplicationStreamingSettingsStore from "../../../stores/ApplicationStreamingSettingsStore";
import ApplicationStreamingStore from "../../../stores/ApplicationStreamingStore";
import ChannelStore from "../../../stores/ChannelStore";
import GuildStore from "../../../stores/GuildStore";
import SelectedChannelStore from "../../../stores/SelectedChannelStore";
import UserStore from "../../../stores/UserStore";
import { ApplicationStreamPresets } from "../StreamSettingsConstants";
import { ApplicationStreamStates } from "../../../Constants";
import { MediaEngineContextTypes } from "../../../_bundle/Module4250";
import { createStyles } from "../../../design/components/Styles/native/createStyles";
import Module712 from "../../../_bundle/Module712";
import { isIOS } from "../../../_bundle/Module501";
import ActionSheetActionCreators from "../../action_sheet/native/ActionSheetActionCreators";
import { ImpressionNames } from "../../../_bundle/Module503";
import { useStateFromStoresObject } from "../../../_bundle/Module589";
import getStreamSettingsForPreset, { canStreamWithPreset, getMaxSettingsForPreset } from "../utils/getStreamSettingsForPreset";
import MobileGoLiveUpsellExperiment from "./MobileGoLiveUpsellExperiment";
import useAnalyticsLocations, { AnalyticsLocationProvider } from "../../app_analytics/useAnalyticsLocations";
import AnalyticsLocation from "../../app_analytics/AnalyticsLocation";
import { useSharedValue } from "../../reanimated/ReanimatedRexport";
import { updateStreamSettings } from "../../../actions/StreamActionCreators";
import AudioActionCreators from "../../../actions/AudioActionCreators";
import { MobilePhoneIcon } from "../../../design/components/Icon/native/redesign/generated/MobilePhoneIcon";
import { intl } from "../../../intl/index.native";
import MobileGoLiveActionSheet_messages from "../MobileGoLiveActionSheet.messages";
import { SpeedometerIcon } from "../../../design/components/Icon/native/redesign/generated/SpeedometerIcon";
import { ImageSparkleIcon } from "../../../design/components/Icon/native/redesign/generated/ImageSparkleIcon";
import NativeView from "../../core/native/NativeView";
import { Text } from "../../../design/components/Text/native/Text";
import { BaseIconImage } from "../../../design/components/Icon/native/BaseIconImage";
import Module9406 from "../../../_bundle/Module9406";
import { BottomSheet } from "../../../design/components/Sheet/native/BottomSheet.native";
import { BottomSheetScrollView } from "../../../_bundle/Module5245";
import { SafeAreaPaddingView } from "../../../components_native/common/SafeAreaView";
import { TableRowGroup } from "../../../design/components/TableRow/native/TableRowGroup.native";
import { TableRadioGroup } from "../../../design/components/TableRow/native/TableRadioGroup.native";
import PremiumUpsellUtils from "../../../utils/native/PremiumUpsellUtils";
import { UpsellTypes } from "../../../ConstantsIOS";
import { TableRadioRow } from "../../../design/components/TableRow/native/TableRadioRow.native";
import PremiumFeatureUpsell from "../../premium/roadblocks/native/views/PremiumFeatureUpsell";
import { EntitlementFeatureNames } from "../../../_bundle/Module6201";
import NitroUpsellButton from "../../premium/components/native/NitroUpsellButton";
import { TableSwitchRow } from "../../../design/components/TableRow/native/TableSwitchRow.native";
import { Button } from "../../../design/components/Button/native/Button.native";
import { stopScreenshare, startStream } from "../../video_calls/native/useScreenshareUtils";
import { HermesBuiltin } from "../../../_hermes/prelude";
const useStyles = createStyles({
wrapper: {
gap: Module712.space.PX_24
},
header: {
textAlign: "center"
},
section: {
marginHorizontal: Module712.space.PX_16
},
highQualityLabel: {
flexDirection: "row",
alignItems: "center",
gap: Module712.space.PX_4
}
});
let c7223_17 = "MobileGoLiveActionSheet";
let c7223_18 = [{
preset: ApplicationStreamPresets.PRESET_MOBILE_DEFAULT,
enabled: true
}, {
preset: ApplicationStreamPresets.PRESET_MOBILE_PERFORMANCE,
enabled: !isIOS()
}, {
preset: ApplicationStreamPresets.PRESET_MOBILE_HIGH_QUALITY,
enabled: true
}].filter((item) => item.enabled).map((item) => item.preset);
const r84 = memo(function MobileGoLiveActionSheet() {
let user, guildPremiumTier, callback, isStreaming, activeSourceId, analyticsLocations, styles, callback2;
const stateFromStoresObject = useStateFromStoresObject([ApplicationStreamingSettingsStore], () => ApplicationStreamingSettingsStore.getState());
let preset = stateFromStoresObject.preset;
const soundshareEnabled = stateFromStoresObject.soundshareEnabled;
const stateFromStoresObject2 = useStateFromStoresObject([UserStore, SelectedChannelStore, ChannelStore, GuildStore], () => {
const currentUser = UserStore.getCurrentUser();
const channel = ChannelStore.getChannel(SelectedChannelStore.getVoiceChannelId());
return {
user: currentUser,
guildPremiumTier: GuildStore.getGuild(channel == null ? void 0 : channel.getGuildId())?.premiumTier
};
});
user = stateFromStoresObject2.user;
guildPremiumTier = stateFromStoresObject2.guildPremiumTier;
callback = useCallback((a0) => canStreamWithPreset(a0, user, guildPremiumTier), [user, guildPremiumTier]);
const stateFromStoresObject3 = useStateFromStoresObject([ApplicationStreamingStore], () => {
const currentUserActiveStream = ApplicationStreamingStore.getCurrentUserActiveStream();
const isStreaming2 = currentUserActiveStream != null && currentUserActiveStream.state === ApplicationStreamStates.ACTIVE;
let activeSourceId2 = ApplicationStreamingStore.getStreamerActiveStreamMetadata()?.sourceId;
if (activeSourceId2 == null) {
activeSourceId2 = null;
}
return {
isStreaming: isStreaming2,
activeSourceId: activeSourceId2
};
});
isStreaming = stateFromStoresObject3.isStreaming;
activeSourceId = stateFromStoresObject3.activeSourceId;
const goLiveUpsellVariant = MobileGoLiveUpsellExperiment.useConfig({
location: "MobileGoLiveActionSheet"
}).goLiveUpsellVariant;
analyticsLocations = useAnalyticsLocations(AnalyticsLocation.MOBILE_GO_LIVE_ACTION_SHEET).analyticsLocations;
styles = useStyles();
if (!((preset === ApplicationStreamPresets.PRESET_MOBILE_DEFAULT || preset === ApplicationStreamPresets.PRESET_MOBILE_PERFORMANCE || preset === ApplicationStreamPresets.PRESET_MOBILE_HIGH_QUALITY) && (c7223_18.includes(preset) && callback(preset)))) {
preset = ApplicationStreamPresets.PRESET_MOBILE_DEFAULT;
}
const [state, setState] = useState(preset);
const [state2, setState2] = useState(soundshareEnabled);
const sharedValue = useSharedValue(!callback(ApplicationStreamPresets.PRESET_MOBILE_HIGH_QUALITY));
callback2 = useCallback((a0, a1) => {
let r15 = getStreamSettingsForPreset(a0, user, guildPremiumTier);
if (r15 == null) {
r15 = [];
}
const [resolution, frameRate] = r15;
if (resolution != null && frameRate != null) {
updateStreamSettings({
preset: a0,
resolution,
frameRate,
soundshareEnabled: a1
});
if (isStreaming) {
const r28 = {
qualityOptions: {
preset: a0,
resolution,
frameRate
},
context: MediaEngineContextTypes.STREAM
};
if (activeSourceId != null) {
r28.desktopSettings = {
sourceId: activeSourceId,
sound: a1
};
}
AudioActionCreators.setGoLiveSource(r28);
}
}
}, [user, guildPremiumTier, activeSourceId, isStreaming]);
return <AnalyticsLocationProvider value={analyticsLocations}>
<BottomSheet startExpanded>
<BottomSheetScrollView>
<SafeAreaPaddingView bottom style={styles.wrapper}>
<Text style={styles.header} variant="redesign/heading-18/bold" color="text-strong" accessibilityRole="header">
{intl.string(MobileGoLiveActionSheet_messages.CrNjqp)}
</Text>
<NativeView style={styles.section}>
<TableRowGroup title={intl.string(MobileGoLiveActionSheet_messages["/XSr8v"])} hasIcons={false}>
<TableRadioGroup value={state} onChange={(event) => {
if (callback(event)) {
setState(event);
callback2(event, state2);
if (isStreaming) {
ActionSheetActionCreators.hideActionSheet(c7223_17);
}
} else {
PremiumUpsellUtils.handleShowUpsellAlert({
initialUpsellKey: UpsellTypes.STREAM_HIGH_QUALITY,
analyticsLocations
});
}
}} hasIcons>
{c7223_18.map((item) => {
const maxSettingsForPreset2 = getMaxSettingsForPreset(ApplicationStreamPresets.PRESET_MOBILE_DEFAULT);
const maxSettingsForPreset3 = getMaxSettingsForPreset(ApplicationStreamPresets.PRESET_MOBILE_PERFORMANCE);
const maxSettingsForPreset = getMaxSettingsForPreset(ApplicationStreamPresets.PRESET_MOBILE_HIGH_QUALITY);
const r37 = {
value: item
};
const PRESET_MOBILE_DEFAULT = ApplicationStreamPresets.PRESET_MOBILE_DEFAULT;
const r42 = {
icon: <MobilePhoneIcon />,
label: intl.string(MobileGoLiveActionSheet_messages["2qmQ8N"]),
subLabel: null
};
const r2 = maxSettingsForPreset2 != null;
let subLabel = "";
const subLabel2 = r2 ? intl.formatToPlainString(MobileGoLiveActionSheet_messages.ibH7vy, maxSettingsForPreset2) : "";
const r57 = {};
r42.subLabel = subLabel2;
r57[PRESET_MOBILE_DEFAULT] = r42;
r57[ApplicationStreamPresets.PRESET_MOBILE_PERFORMANCE] = {
icon: <SpeedometerIcon />,
label: intl.string(MobileGoLiveActionSheet_messages["5eO4/m"]),
subLabel: maxSettingsForPreset3 != null ? intl.formatToPlainString(MobileGoLiveActionSheet_messages.fN0UQY, maxSettingsForPreset3) : ""
};
const PRESET_MOBILE_HIGH_QUALITY = ApplicationStreamPresets.PRESET_MOBILE_HIGH_QUALITY;
const r89 = {
icon: <ImageSparkleIcon />,
label: <NativeView style={styles.highQualityLabel}>
<Text variant="text-md/semibold" color="text-strong">
{intl.string(MobileGoLiveActionSheet_messages.nMcXo1)}
</Text>
<BaseIconImage source={Module9406} size="xs" />
</NativeView>,
subLabel: null
};
if (maxSettingsForPreset != null) {
subLabel = intl.formatToPlainString(MobileGoLiveActionSheet_messages.q4gYBi, maxSettingsForPreset);
}
const props = {};
r89.subLabel = subLabel;
r57[PRESET_MOBILE_HIGH_QUALITY] = r89;
HermesBuiltin.copyDataProperties(r37, r57[item]);
HermesBuiltin.copyDataProperties(props, r37);
return <TableRadioRow key={item} {...props} />;
})}
</TableRadioGroup>
</TableRowGroup>
</NativeView>
{goLiveUpsellVariant === "one-step" && sharedValue.get() && <NativeView style={styles.section}>
<PremiumFeatureUpsell featureName={EntitlementFeatureNames.STREAM_HIGH_QUALITY} shouldShow={sharedValue} />
</NativeView>}
{goLiveUpsellVariant === "two-step" && sharedValue.get() && <NativeView style={styles.section}>
<NitroUpsellButton text={intl.string(MobileGoLiveActionSheet_messages.u72Prd)} onPress={() => {
PremiumUpsellUtils.handleShowUpsellAlert({
initialUpsellKey: UpsellTypes.STREAM_HIGH_QUALITY,
analyticsLocations
});
}} />
</NativeView>}
<NativeView style={styles.section}>
<TableRowGroup title={intl.string(MobileGoLiveActionSheet_messages["j+eAMQ"])} hasIcons={false}>
<TableSwitchRow label={intl.string(MobileGoLiveActionSheet_messages.uwMBDo)} value={state2} onValueChange={(value) => {
setState2(value);
callback2(state, value);
}} />
</TableRowGroup>
</NativeView>
<NativeView style={styles.section}>
<Button {...isStreaming ? {
size: "lg",
variant: "destructive",
text: intl.string(MobileGoLiveActionSheet_messages.OsS9Ll),
onPress: () => {
stopScreenshare();
ActionSheetActionCreators.hideActionSheet(c7223_17);
}
} : {
size: "lg",
variant: "primary",
text: intl.string(MobileGoLiveActionSheet_messages["3wwZ/Q"]),
onPress: () => {
ActionSheetActionCreators.hideActionSheet(c7223_17);
startStream();
}
}} />
</NativeView>
</SafeAreaPaddingView>
</BottomSheetScrollView>
</BottomSheet>
</AnalyticsLocationProvider>;
});
export default r84;
export function showMobileGoLiveActionSheet(a0) {
ActionSheetActionCreators.openLazy(import("./MobileGoLiveActionSheet"), c7223_17, {
impressionName: ImpressionNames.MOBILE_GO_LIVE_ACTION_SHEET,
impressionProperties: {
location_stack: a0
}
});
}
@@ -0,0 +1,20 @@
// Metro module 10752 (f10753).
import { createApexExperiment } from "../../experiments/apex/index";
const apexExperiment = createApexExperiment({
name: "2026-04-mobile-go-live-upsell",
kind: "user",
defaultConfig: {
showMobileGoLiveUpsell: false
},
variations: {
1: {
showMobileGoLiveUpsell: true,
goLiveUpsellVariant: "one-step"
},
2: {
showMobileGoLiveUpsell: true,
goLiveUpsellVariant: "two-step"
}
}
});
export default apexExperiment;
@@ -0,0 +1,166 @@
// Metro module 10567 (f10568).
import { useContext, useRef, useEffect, useCallback } from "react";
import { View } from "react-native";
import { AnalyticEvents } from "../../../Constants";
import { PremiumTypes, PremiumUpsellTypes } from "../../premium/PremiumConstants";
import { ResolutionTypes } from "../../../_bundle/Module4250";
import { createStyles } from "../../../design/components/Styles/native/createStyles";
import Module712 from "../../../_bundle/Module712";
import { RevealContext } from "../../video_calls/native/components/RevealProvider";
import { useAnalyticsContext } from "../../../hooks/analytics";
import useAnalyticsLocations from "../../app_analytics/useAnalyticsLocations";
import ReanimatedRexport, { useAnimatedStyle } from "../../reanimated/ReanimatedRexport";
import * as _timing from "../../../design/animation/reanimated/timing/timing";
import * as _native from "../../../design/void/native";
import { LegacyText, LiveTag } from "../../../design/void/native";
import * as _StreamQualityUtils from "../../../utils/StreamQualityUtils";
import { useMaxQuality, getResolutionText, getFPSText } from "../../../utils/StreamQualityUtils";
import useStreamError from "../useStreamError";
import AnalyticsUtils from "../../../utils/AnalyticsUtils";
import openPremiumModal from "../../../components_native/premium/openPremiumModal";
import { PremiumFeatureCardOrder } from "../../user_settings/premium/native/PremiumFeaturesCards";
import PremiumUtils from "../../../utils/PremiumUtils";
import { PressableOpacity } from "../../../design/void/Pressables/native/Pressables";
import FastImage from "../../../components_native/common/FastImage";
import Module9377 from "../../../_bundle/Module9377";
const useStyles = createStyles({
liveIndicator: {
flexDirection: "row",
alignItems: "center",
height: 18
},
liveTag: {
borderBottomLeftRadius: Module712.radii.none,
borderTopLeftRadius: Module712.radii.none,
height: 18,
textAlign: "center"
},
qualityTag: {
borderBottomLeftRadius: Module712.radii.sm,
borderTopLeftRadius: Module712.radii.sm,
backgroundColor: Module712.unsafe_rawColors.PRIMARY_800,
opacity: 0.8,
paddingLeft: 8,
paddingRight: 4,
flexDirection: "row",
alignItems: "center",
height: 18
},
qualityTagText: {
color: "#fff",
textAlign: "center",
fontWeight: "700"
},
reducedQualityTagText: {
color: Module712.unsafe_rawColors.PRIMARY_300
},
nitroWheel: {
width: 20,
marginLeft: -4
}
});
const __initData = {
code: "function StreamQualityLiveIndicatorTsx1(){const{withTiming,reveal,STANDARD_EASING}=this.__closure;return{opacity:withTiming(reveal?1:0,{easing:STANDARD_EASING,duration:250})};}"
};
export default function StreamQualityLiveIndicator(props) {
let r59, r65, pointerEvents;
let isPremiumFPS, isPremiumResolution, c18132_6;
const { participant, style } = props;
isPremiumFPS = void 0;
isPremiumResolution = void 0;
c18132_6 = void 0;
const styles = useStyles();
const reveal = useContext(RevealContext).reveal;
const location2 = useAnalyticsContext().location;
const analyticsLocations = useAnalyticsLocations().analyticsLocations;
const ref = useRef(false);
const f = function f() {
return {
opacity: _timing.withTiming(reveal ? 1 : 0, {
easing: _native.STANDARD_EASING,
duration: 250
})
};
};
f.__closure = {
withTiming: _timing.withTiming,
reveal,
STANDARD_EASING: _native.STANDARD_EASING
};
f.__workletHash = 14676679064575;
f.__initData = __initData;
const animatedStyle = useAnimatedStyle(f);
const maxQuality = useMaxQuality(participant);
const r54 = useStreamError(participant) != null;
try {
const isPremiumFPS2 = _StreamQualityUtils.isPremiumFPS(maxQuality);
r59 = isPremiumFPS2;
isPremiumFPS = isPremiumFPS2;
} catch ($e) {
r59 = false;
isPremiumFPS = false;
}
try {
const isPremiumResolution2 = _StreamQualityUtils.isPremiumResolution(maxQuality);
r65 = isPremiumResolution2;
isPremiumResolution = isPremiumResolution2;
} catch ($e) {
r65 = false;
isPremiumResolution = false;
}
let r67 = r59 || r65;
c18132_6 = r67;
useEffect(() => {
const current = ref.current;
if (current ? !current : c18132_6) {
AnalyticsUtils.track(AnalyticEvents.PREMIUM_UPSELL_VIEWED, {
type: PremiumUpsellTypes.STREAM_QUALITY_INDICATOR,
has_premium_stream_fps: isPremiumFPS,
has_premium_stream_resolution: isPremiumResolution,
location_stack: analyticsLocations
});
ref.current = true;
}
}, [analyticsLocations, r67, r59, r65]);
const callback = useCallback(() => {
openPremiumModal({
analyticsLocation: location2,
analyticsLocations,
premiumFeatureCardOrder: PremiumFeatureCardOrder.TIER_0_LEADING
});
}, [location2, analyticsLocations]);
const isPremium = PremiumUtils.isPremium(participant.user, PremiumTypes.TIER_1);
const r83 = isPremium ? !isPremium : !PremiumUtils.canStreamQuality(PremiumUtils.StreamQuality.MID, participant.user);
const r98 = PremiumUtils.isPremiumExactly(participant.user, PremiumTypes.TIER_1) && (maxQuality == null ? void 0 : maxQuality.maxResolution.type) === ResolutionTypes.SOURCE && !PremiumUtils.canStreamQuality(PremiumUtils.StreamQuality.HIGH);
const r112 = maxQuality == null;
let r113 = null;
if (!r112) {
L20: {
pointerEvents = "none";
if (r67) {
if (!r83) {
pointerEvents = "none";
if (!r98) {
break L20;
}
}
pointerEvents = "auto";
}
}
if (r67) {
r67 = <FastImage source={Module9377} style={styles.nitroWheel} resizeMode="contain" />;
}
r113 = <ReanimatedRexport.View pointerEvents={pointerEvents} style={[style, animatedStyle]}>
<PressableOpacity accessibilityRole="button" style={[styles.liveIndicator, style]} onPress={callback}>
<View style={styles.qualityTag}>
{r67}
<LegacyText style={[styles.qualityTagText, r54 ? styles.reducedQualityTagText : null]}>
{`${getResolutionText(maxQuality.maxResolution)} ${getFPSText(maxQuality.maxFrameRate)}`}
</LegacyText>
</View>
<LiveTag style={styles.liveTag} />
</PressableOpacity>
</ReanimatedRexport.View>;
}
return r113;
};
@@ -0,0 +1,203 @@
// Metro module 4367 (f4368).
import { Linking } from "react-native";
import ApplicationStreamingStore from "../../../stores/ApplicationStreamingStore";
import ChannelStore from "../../../stores/ChannelStore";
import SelectedChannelStore from "../../../stores/SelectedChannelStore";
import { Base64JPEGPrefix, Endpoints, IOS_BUNDLE_ID, NOOP_NULL } from "../../../Constants";
import { getAppIntentScheme } from "../../activities/Constants";
import Logger from "../../debug/Logger";
import { Timeout } from "../../../_bundle/Timeout";
import { DisableStreamPreviews } from "../../user_settings/UserSettings";
import Dispatcher from "../../../Dispatcher";
import { HTTP } from "../../../_bundle/sendRequest";
import LifecycleManager from "../../../lib/LifecycleManager";
import { getVoiceEngine } from "../../../_bundle/Module4238";
import Module38 from "../../../_bundle/Module38";
import { stopStream, startStream } from "../../../actions/StreamActionCreators";
import ChannelRTCActionCreators from "../../../actions/ChannelRTCActionCreators";
import { encodeStreamKey } from "../utils/StreamKeyUtils";
import { getWindowDimensions } from "../../screen/useWindowDimensions.native";
import { handleCloseScreenshare } from "../../video_calls/native/useScreenshareUtils";
import PushNotification from "../../../lib/pushnotification/PushNotification";
import { intl, t } from "../../../intl/index.native";
import { HermesBuiltin } from "../../../_hermes/prelude";
function $mk114513($env) {
return () => {
const r1 = $env;
return (0, handleThumbnailUpload)(r1[0], r1[1]);
};
}
let c2586_13, c2586_14, c2586_15, c2586_21, c2586_22;
let env2586 = {};
const handleThumbnailUpload = async function handleThumbnailUpload(streamKey, c25057_1) {
let c25057_2, c25057_3, c25057_4;
let c25057_5 = 0;
const r12 = env2586;
L13: {
L12: {
try {
let env29318;
c25057_3 = r12;
const r33 = env29318 = {
$parent: r12
};
c25057_2 = r33;
env29318[0] = streamKey;
env29318[1] = c25057_1;
if (DisableStreamPreviews.getSetting()) {
break L13;
}
c2586_14.stop();
const previewURL = `${Base64JPEGPrefix}${c25057_1}`;
Dispatcher.dispatch({
type: "STREAM_PREVIEW_FETCH_SUCCESS",
streamKey,
previewURL
});
c25057_5 = 1;
await HTTP.post({
url: Endpoints.STREAM_PREVIEW(streamKey),
body: {
thumbnail: previewURL
},
oldFormErrors: true,
rejectWithError: false
});
c25057_5 = 0;
} catch ($e) {
const r31 = $e;
let r8 = r31;
c25057_4 = r31;
if (c25057_5 !== 0) {
while (true) {
try {
const r86 = c25057_2;
const r88 = c25057_4;
c25057_5 = 0;
env29318[2] = r88;
c2586_13.error("Failed to post stream preview", env29318[2]);
c2586_14.start(60000, $mk114513(r86));
break L12;
} catch (r84) {
r8 = r84;
c25057_4 = r84;
if (c25057_5 === 0) {
break;
}
}
}
}
throw r8;
}
}
return void 0;
}
};
const logger = new Logger("VoiceEngineStreamingManager");
c2586_13 = logger;
logger.enableNativeLogger(true);
c2586_14 = new Timeout();
c2586_15 = new Timeout();
env2586[16] = [];
env2586[20] = SelectedChannelStore.getVoiceChannelId();
c2586_21 = Symbol("#e");
class VoiceEngineStreamingManager extends LifecycleManager {
constructor() {
super(...arguments);
if (Object.prototype.hasOwnProperty.call(this, c2586_21)) {
HermesBuiltin.throwTypeError("Cannot initialize private field twice.");
throw new Error("unreachable");
}
this[c2586_21] = ({ channelId }) => {
if (env2586[20] !== channelId) {
const r5 = env2586[19];
if (r5 != null) {
r5.stopBroadcast();
}
ApplicationStreamingStore.getAllActiveStreams().forEach((item) => {
if (item.channelId !== channelId) {
stopStream(encodeStreamKey(item), false);
}
});
}
env2586[20] = channelId;
};
}
_initialize() {
const voiceEngine = getVoiceEngine();
env2586[19] = voiceEngine;
voiceEngine.setBroadcastRequestCallback(() => {
c2586_13.log("Broadcast Requested");
Module38(env2586[19] != null, "Voice Engine should be initialized in callback");
env2586[16] = [];
const channel = ChannelStore.getChannel(SelectedChannelStore.getVoiceChannelId());
const currentAppIntent = ApplicationStreamingStore.getCurrentAppIntent();
if (channel != null) {
startStream(channel.getGuildId(), channel.id, {
sourceId: "screen:0"
});
const currentUserActiveStream = ApplicationStreamingStore.getCurrentUserActiveStream();
if (currentUserActiveStream != null) {
ChannelRTCActionCreators.selectParticipant(channel.id, encodeStreamKey(currentUserActiveStream));
if (env2586[19].platform === "android") {
c2586_15.start(15000, () => {
Module38(env2586[19] != null, "Voice Engine should be initialized in callback");
const windowDimensions = getWindowDimensions();
const r31 = Math.min(512 / windowDimensions.width, 288 / windowDimensions.height);
env2586[19].setBroadcastThumbnailCallback(windowDimensions.width * r31, windowDimensions.height * r31, 300, (a0) => {
c2586_13.log("Broadcast thumbnail of size:", a0.length);
handleThumbnailUpload(encodeStreamKey(currentUserActiveStream), a0);
});
});
}
if (currentAppIntent != null) {
Linking.openURL((0, getAppIntentScheme)(currentAppIntent));
}
}
} else {
env2586[19].stopBroadcastWithError(-1, "Not currently in a voice channel");
}
});
env2586[19].setBroadcastFinishedCallback(() => {
c2586_13.log("Broadcast Finished");
c2586_14.stop();
c2586_15.stop();
handleCloseScreenshare();
});
env2586[19].setBroadcastAnnotatedCallback((a0) => {
c2586_13.log("Broadcast Annotated:", a0);
if (a0 !== IOS_BUNDLE_ID) {
const r11 = env2586[16].indexOf(a0, 0);
if (r11 > -1) {
env2586[16].splice(r11, 1);
}
env2586[16].push(a0);
}
});
env2586[19].setBroadcastBlockedCallback(() => {
c2586_13.log("Broadcast Blocked");
PushNotification.presentLocalNotification({
alertBody: intl.string(t.iYQlwv)
});
});
Dispatcher.subscribe("VOICE_CHANNEL_SELECT", this[c2586_21]);
}
_terminate() {
const voiceEngine = getVoiceEngine();
if (voiceEngine != null) {
voiceEngine.setBroadcastRequestCallback(NOOP_NULL);
voiceEngine.setBroadcastFinishedCallback(NOOP_NULL);
voiceEngine.setBroadcastAnnotatedCallback(NOOP_NULL);
voiceEngine.setBroadcastBlockedCallback(NOOP_NULL);
}
c2586_14.stop();
c2586_15.stop();
Dispatcher.unsubscribe("VOICE_CHANNEL_SELECT", this[c2586_21]);
}
getApplicationNames() {
return env2586[16];
}
}
c2586_22 = VoiceEngineStreamingManager;
const r76 = new VoiceEngineStreamingManager();
export default r76;
+55
View File
@@ -0,0 +1,55 @@
// Metro module 10853 (f10854).
import { useEffect } from "react";
import ApplicationStreamPreviewStore from "../../stores/ApplicationStreamPreviewStore";
import ChannelStore from "../../stores/ChannelStore";
import PermissionStore from "../../stores/PermissionStore";
import SelectedChannelStore from "../../stores/SelectedChannelStore";
import { BasicPermissions } from "../../_bundle/Module505";
import { useStateFromStores, useStateFromStoresObject } from "../../_bundle/Module589";
import { fetchStreamPreview } from "../../actions/StreamActionCreators";
export default function useFetchStreamPreview(a0, a1, a2) {
let shouldFetchPreview, stateFromStores2;
const r0 = a1 == null || a2 == null;
let c18313_3 = r0;
const stateFromStores = useStateFromStores([ChannelStore], () => ChannelStore.getChannel(a1));
let r24 = useStateFromStores([PermissionStore], () => stateFromStores != null && PermissionStore.canBasicChannel(BasicPermissions.CONNECT, stateFromStores));
const stateFromStores3 = useStateFromStores([SelectedChannelStore], () => SelectedChannelStore.getVoiceChannelId() === a1);
const stateFromStoresObject = useStateFromStoresObject([ApplicationStreamPreviewStore], () => {
let isLoading = !c18313_3;
const shouldFetchPreview2 = c18313_3 ? isLoading : ApplicationStreamPreviewStore.shouldFetchPreview(a0, a1, a2);
const previewUrl = c18313_3 ? null : ApplicationStreamPreviewStore.getPreviewURL(a0, a1, a2);
if (!c18313_3) {
isLoading = ApplicationStreamPreviewStore.getIsPreviewLoading(a0, a1, a2);
}
return {
shouldFetchPreview: shouldFetchPreview2,
previewUrl,
isLoading
};
});
shouldFetchPreview = stateFromStoresObject.shouldFetchPreview;
const { previewUrl, isLoading } = stateFromStoresObject;
if (!r24) {
r24 = stateFromStores3;
}
stateFromStores2 = r24;
useEffect(() => {
let r2 = shouldFetchPreview;
if (shouldFetchPreview) {
r2 = !c18313_3;
}
if (r2) {
r2 = stateFromStores2;
}
if (r2) {
fetchStreamPreview(a0, a1, a2);
}
}, [shouldFetchPreview, a1, a0, a2, r0, stateFromStores2]);
return !r0 && stateFromStores2 ? {
previewUrl,
isLoading
} : {
previewUrl: void 0,
isLoading: false
};
};
+25
View File
@@ -0,0 +1,25 @@
// Metro module 10568 (f10569).
import AVErrorStore from "../errors/av_errors/AVErrorStore";
import { AVError } from "../errors/av_errors/AVError";
import { useStateFromStores } from "../../_bundle/Module589";
const r15 = {};
r15[AVError.STREAM_SOUNDSHARE_FAILED] = 0;
r15[AVError.STREAM_SEND_HIGH_PACKET_LOSS] = 1;
r15[AVError.STREAM_VIEW_HIGH_PACKET_LOSS] = 1;
r15[AVError.STREAM_SEND_LOW_FPS] = 2;
r15[AVError.STREAM_VIEW_LOW_FPS] = 2;
r15[AVError.STREAM_BAD_NETWORK_QUALITY] = 3;
let c7104_3 = r15;
export default function useStreamError({ id }) {
return useStateFromStores([AVErrorStore], () => Array.from(AVErrorStore.getActiveErrors().values()).filter((item) => "streamKey" in item && item.streamKey === id && c7104_3[item.type] != null).sort((a, b) => {
let r3 = c7104_3[a.type];
if (r3 == null) {
r3 = 0;
}
let r9 = c7104_3[b.type];
if (r9 == null) {
r9 = 0;
}
return r3 - r9;
})[0]?.type, [id]);
};
+37
View File
@@ -0,0 +1,37 @@
// Metro module 4253 (f4254).
import _slicedToArray from "../../../_bundle/_slicedToArray";
import { StreamTypes } from "../Constants";
export function isStreamKey(a0) {
return a0 != null && (a0.startsWith(StreamTypes.GUILD) || a0.startsWith(StreamTypes.CALL));
}
export function decodeStreamKey(a0) {
const r11 = a0.split(":");
const r7 = r11[0];
if (StreamTypes.GUILD === r7) {
const r31 = _slicedToArray(r11, 4);
return {
streamType: r31[0],
guildId: r31[1],
channelId: r31[2],
ownerId: r31[3]
};
}
if (StreamTypes.CALL === r7) {
const r23 = _slicedToArray(r11, 3);
return {
streamType: r23[0],
channelId: r23[1],
ownerId: r23[2]
};
}
throw new Error(`Unknown stream type ${r7}`);
}
export function encodeStreamKey({ streamType, guildId, channelId, ownerId }) {
if (StreamTypes.GUILD === streamType) {
return [streamType, guildId, channelId, ownerId].join(":");
}
if (StreamTypes.CALL === streamType) {
return [streamType, channelId, ownerId].join(":");
}
throw new Error(`Unknown stream type ${streamType}`);
}
@@ -0,0 +1,124 @@
// Metro module 6010 (f6011).
import GameConsoleStore from "../../game_console/GameConsoleStore";
import { ChannelRecordBase } from "../../../records/ChannelRecord";
import { GUILD_VOCAL_CHANNELS_KEY } from "../../../stores/GuildChannelStore";
import GuildStore from "../../../stores/GuildStore";
import PermissionStore from "../../../stores/PermissionStore";
import VoiceStateStore from "../../../stores/VoiceStateStore";
import { Permissions } from "../../../Constants";
import canJoinVoiceChannel from "../../channel/canJoinVoiceChannel";
import { intl, t } from "../../../intl/index.native";
import { isChannelFull } from "../../../utils/ChannelUtils";
import { shouldAgeVerifyForAgeGate, shouldShowAgeGateForChannelId } from "../../age_gate/AgeGateUtils";
import { useStateFromStoresArray } from "../../../_bundle/Module589";
let c3803_11, canWatchStream;
const canStreamInChannel = function canStreamInChannel(a0, a1, a2, r9 = true) {
if (a0.isPrivate()) {
return true;
}
const guild = a1.getGuild(a0.getGuildId());
let r17 = guild?.maxStageVideoChannelUsers;
if (r17 == null) {
r17 = 0;
}
const r19 = a0.isGuildStageVoice() && r17 <= 0;
let r20 = !r19;
if (!r19) {
if (r9) {
r9 = !canJoinVoiceChannel(a0, a2);
}
r20 = r9 ? !r9 : !!a2.can(Permissions.STREAM, a0) && (guild != null && guild.afkChannelId !== a0.id);
}
return r20;
};
canWatchStream = function canWatchStream(basicChannel2, a1, a2, a3, a4) {
let REMOTE_MODE;
if (basicChannel2 == null) {
return [false, c3803_11.NO_PERMISSION];
}
let r12 = a1.isInChannel(basicChannel2.id);
const r8 = basicChannel2 instanceof ChannelRecordBase && isChannelFull(basicChannel2, a1, a2);
let r23 = canJoinVoiceChannel(basicChannel2, a3);
const r26 = a4.getAwaitingRemoteSessionInfo() != null || a4.getRemoteSessionId() != null;
const r33 = shouldAgeVerifyForAgeGate() && shouldShowAgeGateForChannelId(basicChannel2.id);
L18: {
if (r26) {
REMOTE_MODE = c3803_11.REMOTE_MODE;
} else if (r33) {
REMOTE_MODE = c3803_11.AGE_RESTRICTED;
} else {
if (!r23 && !r12) {
REMOTE_MODE = c3803_11.NO_PERMISSION;
break L18;
}
REMOTE_MODE = r8 && !r12 ? c3803_11.CHANNEL_FULL : void 0;
}
}
let r44 = r26 ? !r26 : !r33;
if (r44) {
if (!r12) {
if (r23) {
r23 = !r8;
}
r12 = r23;
}
r44 = r12;
}
return [r44, REMOTE_MODE];
};
c3803_11 = {
REMOTE_MODE: 0,
0: "REMOTE_MODE",
CHANNEL_FULL: 1,
1: "CHANNEL_FULL",
NO_PERMISSION: 2,
2: "NO_PERMISSION",
AGE_RESTRICTED: 3,
3: "AGE_RESTRICTED"
};
export { canStreamInChannel };
export function getStreamCTAString(a0) {
if (c3803_11.REMOTE_MODE === a0) {
return intl.string(t["1i3tSY"]);
}
if (c3803_11.CHANNEL_FULL === a0) {
return intl.string(t.elyVbv);
}
if (c3803_11.NO_PERMISSION === a0) {
return intl.string(t.pgUTZC);
}
if (c3803_11.AGE_RESTRICTED === a0) {
return intl.string(t.b5FqhF);
}
return intl.string(t["7Xq/nV"]);
}
export function getStreamCTAAriaLabel(a0) {
if (c3803_11.REMOTE_MODE === a0) {
return `${intl.string(t["7Xq/nV"])}: ${intl.string(t["1i3tSY"])}`;
}
if (c3803_11.CHANNEL_FULL === a0) {
return `${intl.string(t["7Xq/nV"])}: ${intl.string(t.elyVbv)}`;
}
if (c3803_11.NO_PERMISSION === a0) {
return `${intl.string(t["7Xq/nV"])}: ${intl.string(t.pgUTZC)}`;
}
if (c3803_11.AGE_RESTRICTED === a0) {
return `${intl.string(t["7Xq/nV"])}: ${intl.string(t.b5FqhF)}`;
}
return `${intl.string(t["7Xq/nV"])}: ${intl.string(t["9C444m"])}`;
}
export { c3803_11 as StreamUnavailableReasons };
export { canWatchStream };
export function useCanWatchStream(c15361_0) {
return useStateFromStoresArray([VoiceStateStore, GuildStore, PermissionStore, GameConsoleStore], () => canWatchStream(c15361_0, VoiceStateStore, GuildStore, PermissionStore, GameConsoleStore));
}
export function getStreamEligibleChannels(a0, a1, a2) {
const r0 = [];
for (const item of a0[GUILD_VOCAL_CHANNELS_KEY]) {
const channel = item.channel;
if (canStreamInChannel(channel, a1, a2)) {
r0.push(channel);
}
}
return r0;
}
@@ -0,0 +1,43 @@
// Metro module 6023 (f6024).
import PresenceStore from "../../../stores/PresenceStore";
import { ActivityTypes } from "../../../Constants";
import isEmbeddedActivity from "../../activities/utils/isEmbeddedActivity";
import shallowEqual from "../../../_bundle/shallowEqual";
import { useStateFromStores } from "../../../_bundle/Module589";
let streamApplicationEqualityCheck;
const _findPlayingActivity = function _findPlayingActivity(a0) {
return a0.type === ActivityTypes.PLAYING && !isEmbeddedActivity(a0);
};
streamApplicationEqualityCheck = function streamApplicationEqualityCheck(a0, a1) {
return a0 === a1 || a0 != null && a1 != null && shallowEqual(a0, a1);
};
export function getStreamerActivityByUserId(a0, a1) {
return a1.findActivity(a0, _findPlayingActivity);
}
export function getStreamerActivity(a0, a1) {
return a0 != null ? a1.findActivity(a0.ownerId, _findPlayingActivity) : null;
}
export function getStreamerApplication(a0, a1) {
if (a0 == null) {
return null;
}
const r4 = a0 != null ? a1.findActivity(a0.ownerId, _findPlayingActivity) : null;
return r4 == null ? null : {
id: r4.application_id,
name: r4.name
};
}
export function useGetStreamApplication(a0) {
return useStateFromStores([PresenceStore], () => {
const r0 = a0 == null;
let r8 = null;
if (!r0) {
const r4 = a0 != null ? PresenceStore.findActivity(a0.ownerId, _findPlayingActivity) : null;
r8 = r4 == null ? null : {
id: r4.application_id,
name: r4.name
};
}
return r8;
}, [a0], streamApplicationEqualityCheck);
}
+6
View File
@@ -0,0 +1,6 @@
// Metro module 12858 (f12859).
import { Features } from "../../../_bundle/Module4250";
Features;
export default function canSpectate(a0) {
return true;
};
@@ -0,0 +1,28 @@
// Metro module 10749 (f10750).
import { ApplicationStreamPresets, ApplicationStreamSettingRequirements } from "../StreamSettingsConstants";
import { getGoLiveAutoQualityExperimentConfig } from "../GoLiveAutoQualityExperiment";
import canUseStreamSetting from "./canUseStreamSetting";
export default function canStreamWithSettings(a0, a1, a2, a3, a4, a5) {
if (a0 === ApplicationStreamPresets.PRESET_AUTO) {
return getGoLiveAutoQualityExperimentConfig({
location: "canStreamWithSettings"
}).allowAutoQuality;
}
for (const applicationStreamSettingRequirement of ApplicationStreamSettingRequirements) {
const r33 = applicationStreamSettingRequirement;
if (applicationStreamSettingRequirement.preset != null && a0 !== r33.preset) {
continue;
}
if (a1 !== r33.resolution) {
continue;
}
if (a2 !== r33.fps) {
continue;
}
if (!canUseStreamSetting(r33, a3, a4, a5)) {
continue;
}
return true;
}
return false;
};
@@ -0,0 +1,28 @@
// Metro module 10751 (f10752).
import { StreamQualities } from "../../premium/PremiumConstants";
import PremiumUtils from "../../../utils/PremiumUtils";
import { isGuildBoostedAtLeast } from "../../../utils/GuildBoostingUtils";
export default function canUseStreamSetting(a0, a1, a2) {
L14: {
if (a0 != null) {
if (a0.quality == null && a0.guildPremiumTier == null) {
break L14;
}
const r2 = a0.quality != null;
let r7 = false;
if (r2) {
const quality = a0.quality;
if (StreamQualities.HIGH_STREAMING_QUALITY === quality) {
r7 = PremiumUtils.canStreamQuality(PremiumUtils.StreamQuality.HIGH, a1);
} else if (StreamQualities.MID_STREAMING_QUALITY === quality) {
r7 = PremiumUtils.canStreamQuality(PremiumUtils.StreamQuality.MID, a1);
} else {
a0.quality;
r7 = false;
}
}
return a0.guildPremiumTier != null ? r7 ? r7 : isGuildBoostedAtLeast(a2, a0.guildPremiumTier) : r7;
}
}
return true;
};
@@ -0,0 +1,22 @@
// Metro module 4365 (f4366).
import RunningGameStore_native from "../../game_detection/RunningGameStore.native";
export default function getSoundshareAnalyticsContext(a0) {
if (a0 == null) {
return {};
}
const sourcePid = a0.sourcePid;
const r1 = sourcePid != null;
let share_game_id = void 0;
let share_game_name = void 0;
if (r1) {
const gameForPID = RunningGameStore_native.getGameForPID(sourcePid);
const name = gameForPID?.name;
share_game_id = gameForPID?.id;
share_game_name = name;
}
return {
soundshare_session: a0.soundshareSession,
share_game_name,
share_game_id
};
};
@@ -0,0 +1,42 @@
// Metro module 16038 (f16039).
import { StreamIssueReportReasons } from "../Constants";
import { intl, t } from "../../../intl/index.native";
export default function getStreamIssueReportOptions({ isEndStream }) {
return [{
id: "black-screen",
value: StreamIssueReportReasons.BLACK_SCREEN,
label: isEndStream ? intl.string(t["0X5Zbq"]) : intl.string(t.fxiRNr)
}, {
id: "blurry",
value: StreamIssueReportReasons.BLURRY,
label: isEndStream ? intl.string(t.VVPQyy) : intl.string(t.E8jTMN)
}, {
id: "lagging",
value: StreamIssueReportReasons.LAGGING,
label: isEndStream ? intl.string(t.ObEHd4) : intl.string(t.VoSJEQ)
}, {
id: "out-of-sync",
value: StreamIssueReportReasons.OUT_OF_SYNC,
label: isEndStream ? intl.string(t.mYmwD3) : intl.string(t["+NluQm"])
}, {
id: "audio-missing",
value: StreamIssueReportReasons.AUDIO_MISSING,
label: isEndStream ? intl.string(t["Xwv41+"]) : intl.string(t.G2egzT)
}, {
id: "audio-poor",
value: StreamIssueReportReasons.AUDIO_POOR,
label: isEndStream ? intl.string(t["fHey+d"]) : intl.string(t.aHOfIo)
}, {
id: "stream-stopped",
value: StreamIssueReportReasons.STREAM_STOPPED,
label: intl.string(t.uEoqQp)
}, {
id: "vibes-off",
value: StreamIssueReportReasons.VIBES_OFF,
label: intl.string(t["++JLL0"])
}, {
id: "other",
value: StreamIssueReportReasons.OTHER,
label: intl.string(t.emlT91)
}];
};
@@ -0,0 +1,72 @@
// Metro module 10747 (f10748).
import { ApplicationStreamFPS, ApplicationStreamPresets, ApplicationStreamResolutions } from "../StreamSettingsConstants";
import GoLiveVideoPresetResolutionExperiment from "../GoLiveVideoPresetResolutionExperiment";
import canStreamWithSettings from "./canStreamWithSettings";
let getStreamSettingsForPreset;
const getApplicationStreamPresetValues = function getApplicationStreamPresetValues() {
const videoPresetResolutionMax = GoLiveVideoPresetResolutionExperiment.getConfig({
location: "getApplicationStreamPresetValues"
}).videoPresetResolutionMax;
const r15 = {};
r15[ApplicationStreamPresets.PRESET_DOCUMENTS] = [{
resolution: ApplicationStreamResolutions.RESOLUTION_SOURCE,
fps: ApplicationStreamFPS.FPS_15
}, {
resolution: ApplicationStreamResolutions.RESOLUTION_SOURCE,
fps: ApplicationStreamFPS.FPS_5
}];
r15[ApplicationStreamPresets.PRESET_VIDEO] = [{
resolution: videoPresetResolutionMax,
fps: ApplicationStreamFPS.FPS_60
}, {
resolution: ApplicationStreamResolutions.RESOLUTION_1080,
fps: ApplicationStreamFPS.FPS_60
}, {
resolution: ApplicationStreamResolutions.RESOLUTION_720,
fps: ApplicationStreamFPS.FPS_60
}, {
resolution: ApplicationStreamResolutions.RESOLUTION_720,
fps: ApplicationStreamFPS.FPS_30
}];
r15[ApplicationStreamPresets.PRESET_AUTO] = [];
r15[ApplicationStreamPresets.PRESET_CUSTOM] = [];
r15[ApplicationStreamPresets.PRESET_MOBILE_DEFAULT] = [{
resolution: ApplicationStreamResolutions.RESOLUTION_720,
fps: ApplicationStreamFPS.FPS_30
}];
r15[ApplicationStreamPresets.PRESET_MOBILE_PERFORMANCE] = [{
resolution: ApplicationStreamResolutions.RESOLUTION_480,
fps: ApplicationStreamFPS.FPS_30
}];
r15[ApplicationStreamPresets.PRESET_MOBILE_HIGH_QUALITY] = [{
resolution: ApplicationStreamResolutions.RESOLUTION_1080,
fps: ApplicationStreamFPS.FPS_60
}];
return r15;
};
getStreamSettingsForPreset = function getStreamSettingsForPreset(a0, a1, a2) {
const r9 = getApplicationStreamPresetValues()[a0];
if (r9 == null) {
return null;
}
for (const item of r9) {
if (!canStreamWithSettings(a0, item.resolution, item.fps, a1, a2)) {
continue;
}
return [item.resolution, item.fps];
}
return null;
};
export default getStreamSettingsForPreset;
export { getApplicationStreamPresetValues };
export function getMaxSettingsForPreset(a0) {
const r7 = getApplicationStreamPresetValues()[a0];
let r8 = r7 == null ? void 0 : r7[0];
if (r8 == null) {
r8 = null;
}
return r8;
}
export function canStreamWithPreset(a0, a1, a2) {
return getStreamSettingsForPreset(a0, a1, a2) != null;
}
@@ -0,0 +1,4 @@
// Metro module 4366 (f4367).
export default function getStreamSourceMetadata() {
return {};
};
@@ -0,0 +1,5 @@
// Metro module 12970 (f12971).
import { intl, t } from "../../../intl/index.native";
export default function getTitleFromPickedStreamContent(a0) {
return a0.windows.length > 0 ? a0.windows.map((window) => window.title).join(", ") : a0.applications.length > 0 ? a0.applications.map((application) => application.name).join(", ") : a0.displays.length > 0 ? intl.string(t.R4wpLN) : null;
};
@@ -0,0 +1,20 @@
// Metro module 16037 (f16038).
import { AnalyticEvents } from "../../../Constants";
import AnalyticsUtils from "../../../utils/AnalyticsUtils";
export default function trackStreamProblem(a0) {
const { problem, stream, feedback, streamApplication, analyticsData, location: location2, rating = null } = a0;
AnalyticsUtils.track(AnalyticEvents.STREAM_REPORT_PROBLEM, {
reason: problem,
category: a0.category,
reason_variant: a0.variant,
streamer_user_id: stream.ownerId,
stream_channel_id: stream.channelId,
guild_id: stream.guildId,
application_id: streamApplication != null ? streamApplication.id : null,
application_name: streamApplication != null ? streamApplication.name : null,
location: location2,
rating,
feedback,
...analyticsData
});
};
@@ -0,0 +1,13 @@
// Metro module 4394 (f4395).
import ChannelStore from "../../../stores/ChannelStore";
import ActionSheetActionCreators from "../../action_sheet/native/ActionSheetActionCreators";
import ModalActionCreators from "../../../actions/ModalActionCreators";
import { openGuildVoiceModal } from "../../../utils/native/PrivateChannelCallUtils";
export default function transitionToStream(a0) {
const channel = ChannelStore.getChannel(a0.channelId);
if (channel != null) {
ActionSheetActionCreators.hideActionSheet();
ModalActionCreators.popAll();
openGuildVoiceModal(channel, "Go Live");
}
};
@@ -0,0 +1,8 @@
// Metro module 12969 (f12970).
export default function windowSourceMatches(a0, a1) {
if (a1 == null) {
return false;
}
const [r12, r13] = a0.split(":");
return r12 === "window" && r13 === a1;
};
@@ -0,0 +1,132 @@
// Metro module 2061 (f2062).
import { loadJsonAsset } from "../../../asset_json/native/AssetJsonUtils";
import * as _Module2062 from "../../../../_bundle/Module2062";
import * as _Module2063 from "../../../../_bundle/Module2063";
import * as _Module2064 from "../../../../_bundle/Module2064";
import * as _Module2065 from "../../../../_bundle/Module2065";
import * as _Module2066 from "../../../../_bundle/Module2066";
import * as _Module2067 from "../../../../_bundle/Module2067";
import * as _Module2068 from "../../../../_bundle/Module2068";
import * as _Module2069 from "../../../../_bundle/Module2069";
import * as _Module2070 from "../../../../_bundle/Module2070";
import * as _Module2071 from "../../../../_bundle/Module2071";
import * as _Module2072 from "../../../../_bundle/Module2072";
import * as _Module2073 from "../../../../_bundle/Module2073";
import * as _Module2074 from "../../../../_bundle/Module2074";
import * as _Module2075 from "../../../../_bundle/Module2075";
import * as _Module2076 from "../../../../_bundle/Module2076";
import * as _Module2077 from "../../../../_bundle/Module2077";
import * as _Module2078 from "../../../../_bundle/Module2078";
import * as _Module2079 from "../../../../_bundle/Module2079";
import * as _Module2080 from "../../../../_bundle/Module2080";
import * as _Module2081 from "../../../../_bundle/Module2081";
import * as _Module2082 from "../../../../_bundle/Module2082";
import * as _Module2083 from "../../../../_bundle/Module2083";
import * as _Module2084 from "../../../../_bundle/Module2084";
import * as _Module2085 from "../../../../_bundle/Module2085";
import * as _Module2086 from "../../../../_bundle/Module2086";
import * as _Module2087 from "../../../../_bundle/Module2087";
import * as _Module2088 from "../../../../_bundle/Module2088";
import * as _Module2089 from "../../../../_bundle/Module2089";
import * as _Module2090 from "../../../../_bundle/Module2090";
import * as _Module2091 from "../../../../_bundle/Module2091";
import * as _Module2092 from "../../../../_bundle/Module2092";
import { createLoader, makeMessagesProxy } from "../../../../_bundle/Module1274";
const loader = createLoader({
bg: () => loadJsonAsset(_Module2062).then((result) => ({
default: result
})),
cs: () => loadJsonAsset(_Module2063).then((result) => ({
default: result
})),
da: () => loadJsonAsset(_Module2064).then((result) => ({
default: result
})),
de: () => loadJsonAsset(_Module2065).then((result) => ({
default: result
})),
el: () => loadJsonAsset(_Module2066).then((result) => ({
default: result
})),
"en-GB": () => loadJsonAsset(_Module2067).then((result) => ({
default: result
})),
"es-419": () => loadJsonAsset(_Module2068).then((result) => ({
default: result
})),
"es-ES": () => loadJsonAsset(_Module2069).then((result) => ({
default: result
})),
fi: () => loadJsonAsset(_Module2070).then((result) => ({
default: result
})),
fr: () => loadJsonAsset(_Module2071).then((result) => ({
default: result
})),
hi: () => loadJsonAsset(_Module2072).then((result) => ({
default: result
})),
hr: () => loadJsonAsset(_Module2073).then((result) => ({
default: result
})),
hu: () => loadJsonAsset(_Module2074).then((result) => ({
default: result
})),
it: () => loadJsonAsset(_Module2075).then((result) => ({
default: result
})),
ja: () => loadJsonAsset(_Module2076).then((result) => ({
default: result
})),
ko: () => loadJsonAsset(_Module2077).then((result) => ({
default: result
})),
lt: () => loadJsonAsset(_Module2078).then((result) => ({
default: result
})),
nl: () => loadJsonAsset(_Module2079).then((result) => ({
default: result
})),
no: () => loadJsonAsset(_Module2080).then((result) => ({
default: result
})),
pl: () => loadJsonAsset(_Module2081).then((result) => ({
default: result
})),
"pt-BR": () => loadJsonAsset(_Module2082).then((result) => ({
default: result
})),
ro: () => loadJsonAsset(_Module2083).then((result) => ({
default: result
})),
ru: () => loadJsonAsset(_Module2084).then((result) => ({
default: result
})),
"sv-SE": () => loadJsonAsset(_Module2085).then((result) => ({
default: result
})),
th: () => loadJsonAsset(_Module2086).then((result) => ({
default: result
})),
tr: () => loadJsonAsset(_Module2087).then((result) => ({
default: result
})),
uk: () => loadJsonAsset(_Module2088).then((result) => ({
default: result
})),
vi: () => loadJsonAsset(_Module2089).then((result) => ({
default: result
})),
"zh-CN": () => loadJsonAsset(_Module2090).then((result) => ({
default: result
})),
"zh-TW": () => loadJsonAsset(_Module2091).then((result) => ({
default: result
})),
"en-US": () => loadJsonAsset(_Module2092).then((result) => ({
default: result
}))
}, "en-US");
const r51 = makeMessagesProxy(loader);
export default r51;
export { loader as messagesLoader };