Files
discord-decomp/sources/modules/video-qoe/MobileMuxWrapper.tsx
T
2026-07-28 01:06:53 +03:00

267 lines
12 KiB
TypeScript

/* Metro module 13611; source: modules/video-qoe/MobileMuxWrapper.tsx; dependencies: [6, 7, 4, 13612, 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 * 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 */
function _fun103931(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#103931, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13808:6, offset: 0x02279160, size: 180 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('MobileMuxWrapper');
logger = _fun103932();
(FileImportTrackerModule).fileFinishedImporting('modules/video-qoe/MobileMuxWrapper.tsx');
exports.MobileMuxWrapper = logger;
function _fun103932() { // fn#103932, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13808:160, offset: 0x02279214, size: 588 bytes, params: 1, frame: 15
return CreateClass(MobileMuxWrapper, [{key: 'initialize', value: value_103934}, {key: 'updatePlayheadTime',
value: function(a0) {
var muxIntegration = this.muxIntegration;
if (muxIntegration != null) {
muxIntegration.updatePlayheadTime(a0);
}
}}, {key: 'updateVideoDimensions', value: function(a0, a1) {
var muxIntegration = this.muxIntegration;
if (muxIntegration != null) {
muxIntegration.updateVideoDimensions(a0, a1);
}
}}, {key: 'updateVideoSourceDimensions', value: function(a0, a1) {
var muxIntegration = this.muxIntegration;
if (muxIntegration != null) {
muxIntegration.updateVideoSourceDimensions(a0, a1);
}
}}, {key: 'updateVideoSource', value: function(a0, a1, a2) {
var muxIntegration = this.muxIntegration;
if (muxIntegration != null) {
muxIntegration.updateVideoSource(a0, a1, a2);
}
}}, {key: 'updatePlayerState', value: function(a0, a1) {
var muxIntegration = this.muxIntegration;
if (muxIntegration != null) {
muxIntegration.updatePlayerState(a0, a1);
}
}}, {key: 'onLoadStart', value: function() {
var muxIntegration = this.muxIntegration;
if (muxIntegration != null) {
muxIntegration.emitLoadStart();
}
}}, {key: 'onLoad', value: function(a0) {
var muxIntegration = this.muxIntegration;
if (muxIntegration != null) {
muxIntegration.emitLoad(a0);
}
}}, {key: 'onPlay', value: function() {
var muxIntegration = this.muxIntegration;
if (muxIntegration != null) {
muxIntegration.emitPlay();
}
}}, {key: 'onPause', value: function() {
var muxIntegration = this.muxIntegration;
if (muxIntegration != null) {
muxIntegration.emitPause();
}
}}, {key: 'onPlaying', value: function() {
var muxIntegration = this.muxIntegration;
if (muxIntegration != null) {
muxIntegration.emitPlaying();
}
}}, {key: 'onCanPlay', value: function() {
var muxIntegration = this.muxIntegration;
if (muxIntegration != null) {
muxIntegration.emitCanPlay();
}
}}, {key: 'onSeek', value: function() {
var env0_0 = this;
if (this.muxIntegration != null) {
if (!this.seekingEmitted) {
this.muxIntegration.emitSeeking();
this.seekingEmitted = true;
}
if (this.seekTimeout != null) {
global.clearTimeout(this.seekTimeout);
}
this.seekTimeout = global.setTimeout(_fun103947, 100);
}
}}, {key: 'onEnd', value: function() {
var muxIntegration = this.muxIntegration;
if (muxIntegration != null) {
muxIntegration.emitEnded();
}
muxIntegration = this.muxIntegration;
if (muxIntegration != null) {
muxIntegration.destroy();
}
}}, {key: 'onError', value: function(a0) {
var muxIntegration = this.muxIntegration;
if (muxIntegration != null) {
muxIntegration.emitError(a0);
}
}}, {key: 'onProgress', value: function(a0) {
this.updatePlayheadTime(a0);
var muxIntegration = this.muxIntegration;
if (muxIntegration != null) {
muxIntegration.emitTimeUpdate();
}
}}, {key: 'onBuffer', value: function(a0) {
var muxIntegration;
if (!a0) {
muxIntegration = this.muxIntegration;
if (muxIntegration != null) {
muxIntegration.emitCanPlay();
}
muxIntegration = this.muxIntegration;
if (muxIntegration != null && muxIntegration.hasPlayStarted()) {
muxIntegration = this.muxIntegration;
if (muxIntegration != null) {
muxIntegration.emitPlaying();
}
}
}
}}, {key: 'onReadyForDisplay', value: function() {
var muxIntegration = this.muxIntegration;
if (muxIntegration != null) {
muxIntegration.emitPlayerReady();
}
muxIntegration = this.muxIntegration;
if (muxIntegration != null && muxIntegration.hasPlayStarted()) {
muxIntegration = this.muxIntegration;
if (muxIntegration != null) {
muxIntegration.emitPlaying();
}
}
}}, {key: 'onVideoTrackChange', value: function(a0, a1) {
var muxIntegration;
var env0_0 = a0;
var value = a1.find(_fun103954);
if (value != null) {
muxIntegration = this.muxIntegration;
if (muxIntegration != null) {
muxIntegration.emitRenditionChange(value.width, value.height, value.bitrate);
}
}
}}, {key: 'destroy', value: value_103955}, {key: 'getSessionId', value: function() {
var r1;
var muxIntegration = this.muxIntegration;
var value = null;
r1 = value == muxIntegration ? undefined : muxIntegration.getSessionId();
return value != r1 ? r1 : value;
}}, {key: 'isInitialized', value: function() {
return this.muxIntegration != null;
}}]);
function MobileMuxWrapper(a0) { // fn#103933, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13808:181, offset: 0x02279460, size: 58 bytes, params: 2, frame: 13
env1_2(this, MobileMuxWrapper);
this.muxIntegration = null;
this.seekingEmitted = false;
this.seekTimeout = null;
this.config = a0;
}
function value_103934() { // fn#103934, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13808:346, offset: 0x0227949a, size: 143 bytes, params: 1, frame: 14
var value;
var property;
var moduleValue;
var MobileCustomMuxIntegration;
var config;
var prototype;
var value2;
var mobileCustomMuxIntegration;
var value3;
var muxIntegration;
var binding;
var error;
try {
value = environment.__proto__;
property = dependencyMap[3];
moduleValue = require(property);
MobileCustomMuxIntegration = moduleValue.MobileCustomMuxIntegration;
config = this.config;
prototype = MobileCustomMuxIntegration.prototype;
value2 = Object.create(prototype, {constructor: {value: MobileCustomMuxIntegration}});
mobileCustomMuxIntegration = new MobileCustomMuxIntegration();
value3 = mobileCustomMuxIntegration instanceof Object ? mobileCustomMuxIntegration : value2;
this.muxIntegration = value3;
muxIntegration = this.muxIntegration;
muxIntegration.initialize();
binding = env1_4;
binding.info('MobileMuxWrapper initialized successfully');
} catch (error) {
binding = env1_4;
binding.error('Error initializing MobileMuxWrapper', error);
this.muxIntegration = null;
}
}
function value_103946() { // fn#103946, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13808:1724, offset: 0x0227969c, size: 123 bytes, params: 1, frame: 14
if (this.muxIntegration != null) {
if (!this.seekingEmitted) {
this.muxIntegration.emitSeeking();
this.seekingEmitted = true;
}
if (this.seekTimeout != null) {
global.clearTimeout(this.seekTimeout);
}
this.seekTimeout = global.setTimeout(_fun103947, 100);
}
function _fun103947() { // fn#103947, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13808:1927, offset: 0x02279717, size: 53 bytes, params: 1, frame: 11
const muxIntegration = env0_0.muxIntegration;
if (muxIntegration != null) {
muxIntegration.emitSeeked();
}
const binding = env0_0;
binding.seekingEmitted = false;
binding.seekTimeout = null;
}
}
function value_103953(a0, a1) { // fn#103953, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13808:2812, offset: 0x0227986b, size: 84 bytes, params: 3, frame: 15
var muxIntegration;
const env0_0 = a0;
const value = a1.find(_fun103954);
if (value != null) {
muxIntegration = this.muxIntegration;
if (muxIntegration != null) {
muxIntegration.emitRenditionChange(value.width, value.height, value.bitrate);
}
}
function _fun103954({trackId}) { // fn#103954, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13808:2842, offset: 0x022798bf, size: 22 bytes, params: 2, frame: 2
return trackId === env0_0;
}
}
function value_103955() { // fn#103955, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13808:2976, offset: 0x022798d5, size: 106 bytes, params: 1, frame: 15
var seekTimeout;
var value;
var clearTimeout;
var muxIntegration;
var error;
var binding;
try {
seekTimeout = this.seekTimeout;
value = seekTimeout == null;
if (!value) {
clearTimeout = global.clearTimeout;
seekTimeout = this.seekTimeout;
clearTimeout(seekTimeout);
this.seekTimeout = null;
}
muxIntegration = this.muxIntegration;
value = muxIntegration == null;
if (!value) {
muxIntegration.destroy();
}
this.muxIntegration = null;
} catch (error) {
value = environment.__proto__;
binding = env1_4;
binding.error('Error destroying MobileMuxWrapper', error);
}
}
}
}
global.__d(_fun103931, 13611, [6, 7, 4, 13612, 2]) /* metro module 13611, dependencies: [6, 7, 4, 13612, 2] */;