150 lines
8.7 KiB
TypeScript
150 lines
8.7 KiB
TypeScript
/* Metro module 10682; source: lib/WindowVisibilityVideoManager.tsx; dependencies: [6, 7, 15, 17, 18, 4041, 3, 672, 10683, 694, 10684, 4479, 2] */
|
|
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 PossibleConstructorReturn from '../by-id/module-00015-PossibleConstructorReturn.js'; /* Metro dependency 15 */
|
|
import Module00017 from '../by-id/module-00017.js'; /* Metro dependency 17 */
|
|
import Inherits from '../by-id/module-00018-Inherits.js'; /* Metro dependency 18 */
|
|
import Durations from '../utils/Durations.tsx'; /* Metro dependency 672 */
|
|
import TypedEventEmitter from '../external/discord_common/js/shared/utils/TypedEventEmitter.tsx'; /* Metro dependency 4479 */
|
|
import * as FileImportTrackerModule from '../by-id/module-00002-FileImportTracker.js'; /* Metro dependency 2 */
|
|
import * as TimersModule from '../external/discord_common/js/packages/timers/Timers.tsx'; /* Metro dependency 4041 */
|
|
|
|
function _fun82127(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#82127, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10868:6, offset: 0x01eec358, size: 266 bytes, params: 8, frame: 19
|
|
const env0_0 = require;
|
|
const Object = global.Object;
|
|
Object.defineProperty(exports, '__esModule', {value: true});
|
|
let value = TypedEventEmitter;
|
|
value = _fun82131(value);
|
|
value = new value();
|
|
(FileImportTrackerModule).fileFinishedImporting('lib/WindowVisibilityVideoManager.tsx');
|
|
exports.WindowVisibilityEvent = {WindowVisibilityChanged: 'window-visibility-changed',
|
|
IncomingVideoEnabledChanged: 'incoming-video-enabled-changed'};
|
|
exports.WindowVisibilityVideoManager = value;
|
|
function _isNativeReflectConstruct_82128() { // fn#82128, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10868:148, offset: 0x01eec462, size: 98 bytes, params: 1, frame: 18
|
|
var Boolean;
|
|
var prototype;
|
|
var valueOf;
|
|
var call;
|
|
var Reflect;
|
|
var construct;
|
|
var closure;
|
|
var value;
|
|
var error;
|
|
try {
|
|
Boolean = global.Boolean;
|
|
prototype = Boolean.prototype;
|
|
valueOf = prototype.valueOf;
|
|
call = valueOf.call;
|
|
Reflect = global.Reflect;
|
|
construct = Reflect.construct;
|
|
Boolean = global.Boolean;
|
|
closure = function() {
|
|
};
|
|
value = Reflect.apply(construct, Reflect, [Boolean, [], closure]);
|
|
value = Reflect.apply(call, valueOf, [value]);
|
|
var result = !value;
|
|
} catch (error) {
|
|
}
|
|
return (_isNativeReflectConstruct_82128_isNativeReflectConstruct = function() {
|
|
return !!result;
|
|
})();
|
|
}
|
|
|
|
function _fun82131(a0) { // fn#82131, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10868:496, offset: 0x01eec4c4, size: 124 bytes, params: 2, frame: 16
|
|
const WindowVisibilityVideoManager2 = WindowVisibilityVideoManager;
|
|
Inherits(WindowVisibilityVideoManager2, a0);
|
|
return CreateClass(WindowVisibilityVideoManager2, [{key: 'isIncomingVideoEnabled', value: function() {
|
|
return this.incomingVideoEnabled;
|
|
}}, {key: 'lastIncomingVideoEnabledChangeTime', value: function() {
|
|
return this.lastEnabledChange;
|
|
}}, {key: 'setIncomingVideoEnabled', value: value_82137}]);
|
|
function WindowVisibilityVideoManager() { // fn#82132, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10868:508, offset: 0x01eec540, size: 395 bytes, params: 1, frame: 21
|
|
var environment;
|
|
let value = environment.__proto__;
|
|
env1_3(this, WindowVisibilityVideoManager);
|
|
const value3 = env1_6(WindowVisibilityVideoManager);
|
|
const value6 = env1_5(this, _isNativeReflectConstruct_82128() ? global.Reflect.construct(value3, [],
|
|
env1_6(this).constructor) : value3.apply(this, undefined));
|
|
const Timeout = (TimersModule).Timeout;
|
|
const value7 = Object.create(Timeout.prototype, {constructor: {value: Timeout}});
|
|
const timeout = new Timeout();
|
|
value6.disableVideoTimer = timeout instanceof Object ? timeout : value7;
|
|
value6.discordVisible = true;
|
|
value6.incomingVideoEnabled = true;
|
|
value6.lastEnabledChange = global.performance.now();
|
|
value = importDefault(3) /* metro dependency 3: Logger */;
|
|
value = new value('WindowVisibilityVideoManager');
|
|
value6.logger = value;
|
|
const Millis = (Durations).Millis;
|
|
const SECOND = Millis.SECOND;
|
|
value6.HIDDEN_WINDOW_DISABLE_VIDEO_DURATION_MS = 30 * SECOND;
|
|
value6.update = update_82133;
|
|
value = importDefault(694) /* metro dependency 694: Dispatcher */;
|
|
value.subscribe('WINDOW_VISIBILITY_CHANGE', value6.update);
|
|
value = importDefault(694) /* metro dependency 694: Dispatcher */;
|
|
value.subscribe('APP_STATE_UPDATE', value6.update);
|
|
value = importDefault(10684) /* metro dependency 10684: ExternalPipAndroid */;
|
|
value.addOnPipModeChangedListener(value6.update);
|
|
return value6;
|
|
function WindowVisibilityVideoManagerUpdate() { // fn#82133, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10868:1022, owner: WindowVisibilityVideoManager.update, offset: 0x01eec6cb, size: 180 bytes, params: 1, frame: 16
|
|
var binding;
|
|
var emit;
|
|
var WindowVisibilityChanged;
|
|
var disableVideoTimer;
|
|
let discordVisible = env0_0.discordVisible;
|
|
if (discordVisible !== (importDefault(10683) /* metro dependency 10683: WindowVisibilityUtilsNative */)()) {
|
|
binding = env0_0;
|
|
binding.discordVisible = (importDefault(10683) /* metro dependency 10683: WindowVisibilityUtilsNative */)();
|
|
emit = binding.emit;
|
|
WindowVisibilityChanged = env2_8.WindowVisibilityChanged;
|
|
discordVisible = binding.discordVisible;
|
|
Reflect.apply(emit, binding, [WindowVisibilityChanged, discordVisible]);
|
|
discordVisible = binding.discordVisible;
|
|
binding = env0_0;
|
|
disableVideoTimer = binding.disableVideoTimer;
|
|
if (discordVisible) {
|
|
disableVideoTimer.stop();
|
|
binding.setIncomingVideoEnabled(true);
|
|
} else {
|
|
disableVideoTimer.start(binding.HIDDEN_WINDOW_DISABLE_VIDEO_DURATION_MS, _fun82134);
|
|
}
|
|
}
|
|
function _fun82134() { // fn#82134, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10868:1281, offset: 0x01eec77f, size: 24 bytes, params: 1, frame: 11
|
|
env1_0.setIncomingVideoEnabled(false);
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
function value_82137(a0) { // fn#82137, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10868:1755, offset: 0x01eec7ad, size: 125 bytes, params: 2, frame: 16
|
|
var logger;
|
|
var info;
|
|
var performance;
|
|
var emit;
|
|
var value;
|
|
var IncomingVideoEnabledChanged;
|
|
let incomingVideoEnabled = this.incomingVideoEnabled;
|
|
this.incomingVideoEnabled = a0;
|
|
if (incomingVideoEnabled !== a0) {
|
|
logger = this.logger;
|
|
info = logger.info;
|
|
incomingVideoEnabled = this.incomingVideoEnabled;
|
|
Reflect.apply(info, logger, ['Incoming video enabled changed, incomingVideoEnabled = ' + incomingVideoEnabled]);
|
|
performance = global.performance;
|
|
this.lastEnabledChange = performance.now();
|
|
emit = this.emit;
|
|
value = environment.__proto__;
|
|
IncomingVideoEnabledChanged = env1_8.IncomingVideoEnabledChanged;
|
|
incomingVideoEnabled = this.incomingVideoEnabled;
|
|
Reflect.apply(emit, this, [IncomingVideoEnabledChanged, incomingVideoEnabled]);
|
|
}
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
global.__d(_fun82127, 10682, [6, 7, 15, 17, 18, 4041, 3, 672, 10683, 694, 10684, 4479,
|
|
2]) /* metro module 10682, dependencies: [6, 7, 15, 17, 18, 4041, 3, 672, 10683, 694, 10684, 4479, 2] */;
|