457 lines
24 KiB
TypeScript
457 lines
24 KiB
TypeScript
/* Metro module 12489; source: modules/media_engine/InputWatcher.tsx; dependencies: [57, 5, 6, 7, 4286, 4, 4041, 478, 12427, 3767, 6731, 694, 4406, 2] */
|
|
import Module00005 from '../../by-id/module-00005.js'; /* Metro dependency 5 */
|
|
import ClassCallCheck from '../../by-id/module-00006-ClassCallCheck.js'; /* Metro dependency 6 */
|
|
import CreateClass from '../../by-id/module-00007-CreateClass.js'; /* Metro dependency 7 */
|
|
import Module00057 from '../../by-id/module-00057.js'; /* Metro dependency 57 */
|
|
import * as FileImportTrackerModule from '../../by-id/module-00002-FileImportTracker.js'; /* Metro dependency 2 */
|
|
import * as LoggerModule from '../../external/discord_common/js/packages/logger/Logger.tsx'; /* Metro dependency 4 */
|
|
import * as TimersModule from '../../external/discord_common/js/packages/timers/Timers.tsx'; /* Metro dependency 4041 */
|
|
import * as ConstantsModule from '../go_live/Constants.tsx'; /* Metro dependency 4286 */
|
|
import * as MediaEngineModule from '../../external/discord_common/js/packages/media-engine/index.tsx'; /* Metro dependency 4406 */
|
|
|
|
function _fun95035(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#95035, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12679:6, offset: 0x0212f4fb, size: 240 bytes, params: 8, frame: 19
|
|
const env0_0 = require;
|
|
const Object = global.Object;
|
|
Object.defineProperty(exports, '__esModule', {value: true});
|
|
const Logger = (LoggerModule).Logger;
|
|
let logger = new Logger('InputWatcher');
|
|
logger = _fun95036();
|
|
(FileImportTrackerModule).fileFinishedImporting('modules/media_engine/InputWatcher.tsx');
|
|
exports.default = logger;
|
|
function _fun95036() { // fn#95036, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12679:232, offset: 0x0212f5eb, size: 59 bytes, params: 1, frame: 14
|
|
return CreateClass(InputWatcher, [{key: 'reset', value: function() {
|
|
this.stateChangeTimeout.stop();
|
|
if (this.inputDetected != null) {
|
|
this.handleSilence(!this.inputDetected);
|
|
}
|
|
this.inputDetected = undefined;
|
|
}}]);
|
|
function InputWatcher(a0, a1) { // fn#95037, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12679:253, offset: 0x0212f626, size: 219 bytes, params: 3, frame: 17
|
|
env1_5(this, InputWatcher);
|
|
this.mediaEngine = a0;
|
|
this.mediaEngineStore = a1;
|
|
const Timeout = (TimersModule).Timeout;
|
|
const value3 = Object.create(Timeout.prototype, {constructor: {value: Timeout}});
|
|
const timeout = new Timeout();
|
|
this.stateChangeTimeout = timeout instanceof Object ? timeout : value3;
|
|
this.inputDetected = undefined;
|
|
const performance = global.performance;
|
|
this.lastUpdateTime = performance.now();
|
|
this.fetchInputDeviceOSConfig = env1_4(_fun95039);
|
|
this.handleSilence = handleSilence;
|
|
const mediaEngine = this.mediaEngine;
|
|
const on = mediaEngine.on;
|
|
const MediaEngineEvent = (MediaEngineModule).MediaEngineEvent;
|
|
const Silence = MediaEngineEvent.Silence;
|
|
var handleSilence = this.handleSilence;
|
|
Reflect.apply(on, mediaEngine, [Silence, handleSilence]);
|
|
function* _fun95039() { // fn#95039, original name: ?anon_0_, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12679:497, offset: 0x0212f70c, size: 500 bytes, params: 1, frame: 21
|
|
var release;
|
|
var guid;
|
|
var value3;
|
|
var binding;
|
|
var value4;
|
|
var isWindows;
|
|
var binding2;
|
|
var value5;
|
|
var satisfies;
|
|
var value6;
|
|
var os;
|
|
var value7;
|
|
var mediaEngineStore;
|
|
var getInputDeviceId;
|
|
var value8;
|
|
var getInputDevices;
|
|
var value9;
|
|
var property;
|
|
var value10;
|
|
var value11;
|
|
var value12;
|
|
var binding3;
|
|
var value13;
|
|
var ensureModule;
|
|
var value14;
|
|
var value15;
|
|
var value16;
|
|
var Promise;
|
|
var all;
|
|
var mediaEngine;
|
|
var getDeviceOSVolume;
|
|
var value17;
|
|
var object;
|
|
var getDeviceOSMuted;
|
|
var value18;
|
|
var value19;
|
|
var value20;
|
|
var value21;
|
|
var value22;
|
|
var property2;
|
|
var binding4;
|
|
var property3;
|
|
var value23;
|
|
var dispatch;
|
|
var error;
|
|
var warn;
|
|
var HermesInternal;
|
|
var concat;
|
|
let value = undefined;
|
|
if (true) {
|
|
reduciblePort73: while (true) {
|
|
exceptionLanding72: while (true) {
|
|
value = undefined;
|
|
value3 = environment.__proto__.__proto__.__proto__;
|
|
binding = env3_0;
|
|
value4 = binding(env3_2[7]);
|
|
isWindows = value4.isWindows;
|
|
if (Reflect.apply(isWindows, value4, [])) {
|
|
binding = env3_1;
|
|
binding2 = env3_2;
|
|
value5 = binding(binding2[8]);
|
|
satisfies = value5.satisfies;
|
|
value6 = binding(binding2[9]);
|
|
reducibleJoin4: while (true) {
|
|
if (value6 == null) {
|
|
release = value;
|
|
break reducibleJoin4;
|
|
}
|
|
binding = env3_1;
|
|
os = binding(env3_2[9]).os;
|
|
release = os.release;
|
|
break reducibleJoin4;
|
|
}
|
|
if (Reflect.apply(satisfies, value5, [release, env3_7])) {
|
|
value7 = environment.__proto__;
|
|
try {
|
|
binding = env1_1;
|
|
} catch (error) {
|
|
break exceptionLanding72;
|
|
}
|
|
try {
|
|
mediaEngineStore = binding.mediaEngineStore;
|
|
} catch (error) {
|
|
break exceptionLanding72;
|
|
}
|
|
try {
|
|
getInputDeviceId = mediaEngineStore.getInputDeviceId;
|
|
} catch (error) {
|
|
break exceptionLanding72;
|
|
}
|
|
try {
|
|
value8 = Reflect.apply(getInputDeviceId, mediaEngineStore, []);
|
|
} catch (error) {
|
|
break exceptionLanding72;
|
|
}
|
|
try {
|
|
mediaEngineStore = binding.mediaEngineStore;
|
|
} catch (error) {
|
|
break exceptionLanding72;
|
|
}
|
|
try {
|
|
getInputDevices = mediaEngineStore.getInputDevices;
|
|
} catch (error) {
|
|
break exceptionLanding72;
|
|
}
|
|
try {
|
|
value9 = Reflect.apply(getInputDevices, mediaEngineStore, []);
|
|
} catch (error) {
|
|
break exceptionLanding72;
|
|
}
|
|
try {
|
|
property = value9[value8];
|
|
} catch (error) {
|
|
break exceptionLanding72;
|
|
}
|
|
try {
|
|
value10 = property == null;
|
|
} catch (error) {
|
|
break exceptionLanding72;
|
|
}
|
|
reducibleJoin18: while (true) {
|
|
if (value10) {
|
|
guid = value;
|
|
break reducibleJoin18;
|
|
}
|
|
try {
|
|
guid = property.guid;
|
|
} catch (error) {
|
|
break exceptionLanding72;
|
|
}
|
|
break reducibleJoin18;
|
|
}
|
|
try {
|
|
value11 = guid == null;
|
|
} catch (error) {
|
|
break exceptionLanding72;
|
|
}
|
|
if (value11) {
|
|
break reduciblePort73;
|
|
}
|
|
try {
|
|
value12 = guid === '';
|
|
} catch (error) {
|
|
break exceptionLanding72;
|
|
}
|
|
if (value12) {
|
|
break reduciblePort73;
|
|
}
|
|
try {
|
|
binding = env3_0;
|
|
} catch (error) {
|
|
break exceptionLanding72;
|
|
}
|
|
try {
|
|
binding3 = env3_2;
|
|
} catch (error) {
|
|
break exceptionLanding72;
|
|
}
|
|
try {
|
|
property = binding3[10];
|
|
} catch (error) {
|
|
break exceptionLanding72;
|
|
}
|
|
try {
|
|
value13 = binding(property);
|
|
} catch (error) {
|
|
break exceptionLanding72;
|
|
}
|
|
try {
|
|
property = value13.default;
|
|
} catch (error) {
|
|
break exceptionLanding72;
|
|
}
|
|
try {
|
|
ensureModule = property.ensureModule;
|
|
} catch (error) {
|
|
break exceptionLanding72;
|
|
}
|
|
try {
|
|
value14 = Reflect.apply(ensureModule, property, ['discord_voice']);
|
|
} catch (error) {
|
|
break exceptionLanding72;
|
|
}
|
|
yield value14;
|
|
try {
|
|
value15 = undefined;
|
|
value16 = false;
|
|
} catch (error) {
|
|
break exceptionLanding72;
|
|
}
|
|
if (value16) {
|
|
return value15;
|
|
}
|
|
try {
|
|
Promise = global.Promise;
|
|
} catch (error) {
|
|
break exceptionLanding72;
|
|
}
|
|
try {
|
|
all = Promise.all;
|
|
} catch (error) {
|
|
break exceptionLanding72;
|
|
}
|
|
try {
|
|
binding = env1_1;
|
|
} catch (error) {
|
|
break exceptionLanding72;
|
|
}
|
|
try {
|
|
mediaEngine = binding.mediaEngine;
|
|
} catch (error) {
|
|
break exceptionLanding72;
|
|
}
|
|
try {
|
|
getDeviceOSVolume = mediaEngine.getDeviceOSVolume;
|
|
} catch (error) {
|
|
break exceptionLanding72;
|
|
}
|
|
try {
|
|
value17 = Reflect.apply(getDeviceOSVolume, mediaEngine, [guid]);
|
|
} catch (error) {
|
|
break exceptionLanding72;
|
|
}
|
|
try {
|
|
object = [];
|
|
} catch (error) {
|
|
break exceptionLanding72;
|
|
}
|
|
try {
|
|
object[0] = value17;
|
|
} catch (error) {
|
|
break exceptionLanding72;
|
|
}
|
|
try {
|
|
mediaEngine = binding.mediaEngine;
|
|
} catch (error) {
|
|
break exceptionLanding72;
|
|
}
|
|
try {
|
|
getDeviceOSMuted = mediaEngine.getDeviceOSMuted;
|
|
} catch (error) {
|
|
break exceptionLanding72;
|
|
}
|
|
try {
|
|
value18 = Reflect.apply(getDeviceOSMuted, mediaEngine, [guid]);
|
|
} catch (error) {
|
|
break exceptionLanding72;
|
|
}
|
|
try {
|
|
object[1] = value18;
|
|
} catch (error) {
|
|
break exceptionLanding72;
|
|
}
|
|
try {
|
|
value19 = Reflect.apply(all, Promise, [object]);
|
|
} catch (error) {
|
|
break exceptionLanding72;
|
|
}
|
|
yield value19;
|
|
try {
|
|
value20 = undefined;
|
|
value21 = false;
|
|
} catch (error) {
|
|
break exceptionLanding72;
|
|
}
|
|
if (value21) {
|
|
return value20;
|
|
}
|
|
try {
|
|
binding = env3_3;
|
|
} catch (error) {
|
|
break exceptionLanding72;
|
|
}
|
|
try {
|
|
value22 = binding(value20, 2);
|
|
} catch (error) {
|
|
break exceptionLanding72;
|
|
}
|
|
try {
|
|
property = value22[0];
|
|
} catch (error) {
|
|
break exceptionLanding72;
|
|
}
|
|
try {
|
|
property2 = value22[1];
|
|
} catch (error) {
|
|
break exceptionLanding72;
|
|
}
|
|
try {
|
|
binding = env3_1;
|
|
} catch (error) {
|
|
break exceptionLanding72;
|
|
}
|
|
try {
|
|
binding4 = env3_2;
|
|
} catch (error) {
|
|
break exceptionLanding72;
|
|
}
|
|
try {
|
|
property3 = binding4[11];
|
|
} catch (error) {
|
|
break exceptionLanding72;
|
|
}
|
|
try {
|
|
value23 = binding(property3);
|
|
} catch (error) {
|
|
break exceptionLanding72;
|
|
}
|
|
try {
|
|
dispatch = value23.dispatch;
|
|
} catch (error) {
|
|
break exceptionLanding72;
|
|
}
|
|
try {
|
|
object = {};
|
|
} catch (error) {
|
|
break exceptionLanding72;
|
|
}
|
|
try {
|
|
object.type = 'AUDIO_INPUT_DEVICE_OS_CONFIG_FETCHED';
|
|
} catch (error) {
|
|
break exceptionLanding72;
|
|
}
|
|
try {
|
|
object.osVolume = property;
|
|
} catch (error) {
|
|
break exceptionLanding72;
|
|
}
|
|
try {
|
|
object.osMuted = property2;
|
|
} catch (error) {
|
|
break exceptionLanding72;
|
|
}
|
|
try {
|
|
Reflect.apply(dispatch, value23, [object]);
|
|
} catch (error) {
|
|
break exceptionLanding72;
|
|
}
|
|
break reduciblePort73;
|
|
}
|
|
break reduciblePort73;
|
|
}
|
|
break reduciblePort73;
|
|
}
|
|
binding = env3_8;
|
|
warn = binding.warn;
|
|
HermesInternal = global.HermesInternal;
|
|
concat = HermesInternal.concat;
|
|
Reflect.apply(warn, binding, ['Failed to get device OS volume and/or mute state: ' + error]);
|
|
break reduciblePort73;
|
|
}
|
|
}
|
|
return value;
|
|
}
|
|
|
|
function handleSilence(a0) { // fn#95040, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12679:1094, owner: InputWatcher.handleSilence, offset: 0x0212f900, size: 78 bytes, params: 2, frame: 15
|
|
var environment;
|
|
const env0_0 = a0;
|
|
const result = !a0;
|
|
const stateChangeTimeout = env0_0.stateChangeTimeout;
|
|
const start = stateChangeTimeout.start;
|
|
const r2 = a0 ? 5000 : 1500;
|
|
const value = environment.__proto__.__proto__;
|
|
Reflect.apply(start, stateChangeTimeout, [r2, env2_4(_fun95042)]);
|
|
function* _fun95042() { // fn#95042, original name: ?anon_0_, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12679:1151, offset: 0x0212f959, size: 186 bytes, params: 1, frame: 17
|
|
var dispatch;
|
|
if (true) {
|
|
value = environment.__proto__.__proto__.__proto__.__proto__;
|
|
var binding = env4_8;
|
|
var info = binding.info;
|
|
var binding2 = env1_0;
|
|
Reflect.apply(info, binding, ['Silence:', binding2]);
|
|
binding = env2_1;
|
|
binding.inputDetected = env1_1;
|
|
binding.lastUpdateTime = global.performance.now();
|
|
if (binding2) {
|
|
binding = env2_1;
|
|
yield binding.fetchInputDeviceOSConfig();
|
|
if (false) {
|
|
return undefined;
|
|
}
|
|
binding = env4_1;
|
|
value = binding(env4_2[11]);
|
|
dispatch = value.dispatch;
|
|
binding = env2_1;
|
|
Reflect.apply(dispatch, value, [{type: 'AUDIO_INPUT_DETECTED', inputDetected: binding.inputDetected,
|
|
lastUpdateTime: binding.lastUpdateTime}]);
|
|
} else {
|
|
binding = env4_1;
|
|
value = binding(env4_2[11]);
|
|
dispatch = value.dispatch;
|
|
binding = env2_1;
|
|
Reflect.apply(dispatch, value, [{type: 'AUDIO_INPUT_DETECTED', inputDetected: binding.inputDetected,
|
|
lastUpdateTime: binding.lastUpdateTime}]);
|
|
}
|
|
}
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
global.__d(_fun95035, 12489, [57, 5, 6, 7, 4286, 4, 4041, 478, 12427, 3767, 6731, 694, 4406,
|
|
2]) /* metro module 12489, dependencies: [57, 5, 6, 7, 4286, 4, 4041, 478, 12427, 3767, 6731, 694, 4406, 2] */;
|