74 lines
4.9 KiB
TypeScript
74 lines
4.9 KiB
TypeScript
/* Metro module 10681; source: modules/errors/hooks/useVideoReadyTimeout.tsx; dependencies: [31, 672, 4041, 10680, 4406, 10682, 10685, 2] */
|
|
import Durations from '../../../utils/Durations.tsx'; /* Metro dependency 672 */
|
|
import * as FileImportTrackerModule from '../../../by-id/module-00002-FileImportTracker.js'; /* Metro dependency 2 */
|
|
import * as ReactModule from '../../../by-id/module-00031-React.js'; /* Metro dependency 31 */
|
|
import * as TimersModule from '../../../external/discord_common/js/packages/timers/Timers.tsx'; /* Metro dependency 4041 */
|
|
import * as MediaEngineModule from '../../../external/discord_common/js/packages/media-engine/index.tsx'; /* Metro dependency 4406 */
|
|
import * as VideoSpinnerTimerModule from '../../../lib/VideoSpinnerTimer.tsx'; /* Metro dependency 10680 */
|
|
import * as VideoStreamReadyActionCreatorsModule from '../VideoStreamReadyActionCreators.tsx'; /* Metro dependency 10685 */
|
|
|
|
function _fun82121(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#82121, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10867:6, offset: 0x01eec051, size: 152 bytes, params: 8, frame: 18
|
|
const env0_0 = require;
|
|
const Object = global.Object;
|
|
Object.defineProperty(exports, '__esModule', {value: true});
|
|
const Millis = (Durations).Millis;
|
|
const SECOND = Millis.SECOND;
|
|
const env0_3 = 20 * SECOND;
|
|
(FileImportTrackerModule).fileFinishedImporting('modules/errors/hooks/useVideoReadyTimeout.tsx');
|
|
exports.default = useVideoReadyTimeout;
|
|
function useVideoReadyTimeout({streamId, userId, videoSpinnerContext, streamKey, loading, paused}) { // fn#82122, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10867:222, offset: 0x01eec0e9, size: 363 bytes, params: 2, frame: 24
|
|
const MediaEngineContextTypes = (MediaEngineModule).MediaEngineContextTypes;
|
|
const streamKey2 = streamKey;
|
|
paused = !(paused === undefined) && paused;
|
|
let binding = streamKey2;
|
|
const useRef = binding.useRef;
|
|
const Timeout = (TimersModule).Timeout;
|
|
const value2 = Object.create(Timeout.prototype, {constructor: {value: Timeout}});
|
|
const timeout = new Timeout();
|
|
const env0_5 = Reflect.apply(useRef, binding, [timeout instanceof Object ? timeout : value2]);
|
|
const VideoSpinnerContext = (VideoSpinnerTimerModule).VideoSpinnerContext;
|
|
const SELF_STREAM = VideoSpinnerContext.SELF_STREAM;
|
|
const r5 = videoSpinnerContext === SELF_STREAM || videoSpinnerContext === VideoSpinnerContext.REMOTE_STREAM ? MediaEngineContextTypes.STREAM : MediaEngineContextTypes.DEFAULT;
|
|
binding = streamKey2;
|
|
binding.useEffect(_fun82123, [paused, streamId, loading, r5, streamKey, userId]);
|
|
const useCallback = binding.useCallback;
|
|
return {onReady: Reflect.apply(useCallback, binding, [_fun82126, [userId, r5]])};
|
|
function _fun82123() { // fn#82123, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10867:560, offset: 0x01eec254, size: 111 bytes, params: 1, frame: 15
|
|
var environment;
|
|
var value2;
|
|
var WindowVisibilityVideoManager;
|
|
var current;
|
|
if (loading) {
|
|
if (paused) {
|
|
return undefined;
|
|
}
|
|
value2 = environment.__proto__;
|
|
WindowVisibilityVideoManager = (require(10682) /* metro dependency 10682: WindowVisibilityVideoManager */).WindowVisibilityVideoManager;
|
|
if (WindowVisibilityVideoManager.isIncomingVideoEnabled()) {
|
|
current = env0_5.current;
|
|
current.start(env1_3, _fun82124);
|
|
return function() {
|
|
current.stop();
|
|
};
|
|
}
|
|
}
|
|
function _fun82124() { // fn#82124, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10867:672, offset: 0x01eec2c3, size: 59 bytes, params: 1, frame: 18
|
|
let value = environment.__proto__.__proto__;
|
|
value = require(10685) /* metro dependency 10685: VideoStreamReadyActionCreators */;
|
|
value.videoStreamTimedOut(streamId, userId, env1_6, streamKey);
|
|
}
|
|
|
|
}
|
|
|
|
function _fun82126() { // fn#82126, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10867:774, offset: 0x01eec313, size: 69 bytes, params: 1, frame: 14
|
|
env0_5.current.stop();
|
|
VideoStreamReadyActionCreatorsModule.clearVideoStreamTimeout(env0_6, userId);
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
global.__d(_fun82121, 10681, [31, 672, 4041, 10680, 4406, 10682, 10685,
|
|
2]) /* metro module 10681, dependencies: [31, 672, 4041, 10680, 4406, 10682, 10685, 2] */;
|