174 lines
10 KiB
TypeScript
174 lines
10 KiB
TypeScript
/* Metro module 9551; source: modules/media_viewer/native/useVideoControls.tsx; dependencies: [57, 31, 4502, 33, 629, 690, 9552, 4501, 566, 9545, 6266, 9546, 9553, 2] */
|
|
import Module00057 from '../../../by-id/module-00057.js'; /* Metro dependency 57 */
|
|
import AccessibilityStore from '../../a11y/AccessibilityStore.tsx'; /* Metro dependency 4502 */
|
|
import UsePrevious from '../../../hooks/usePrevious.tsx'; /* Metro dependency 6266 */
|
|
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 JsxRuntimeModule from '../../../by-id/module-00033-JsxRuntime.js'; /* Metro dependency 33 */
|
|
import * as Module00629Module from '../../../by-id/module-00629.js'; /* Metro dependency 629 */
|
|
import * as ReactBatchUpdatesNativeModule from '../../../external/discord_common/js/shared/utils/ReactBatchUpdates.native.tsx'; /* Metro dependency 690 */
|
|
import * as CreateStylesModule from '../../../design/components/Styles/native/createStyles.tsx'; /* Metro dependency 4501 */
|
|
import * as UseMediaViewerSourcesModule from './useMediaViewerSources.tsx'; /* Metro dependency 9545 */
|
|
import * as MediaPlayerMuteManagerModule from './MediaPlayerMuteManager.tsx'; /* Metro dependency 9552 */
|
|
|
|
function _fun74566(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#74566, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9737:6, offset: 0x01d9238f, size: 346 bytes, params: 8, frame: 21
|
|
const env0_0 = require;
|
|
const Object = global.Object;
|
|
Object.defineProperty(exports, '__esModule', {value: true});
|
|
let value = Module00629Module;
|
|
value = value.create(function() {
|
|
return {controls: undefined, paused: false};
|
|
});
|
|
const env0_8 = (CreateStylesModule).createStyles({slider: {marginBottom: 8}});
|
|
(FileImportTrackerModule).fileFinishedImporting('modules/media_viewer/native/useVideoControls.tsx');
|
|
exports.default = useVideoControls;
|
|
exports.useVideoStateStore = value;
|
|
exports.initVideoStateStore = initVideoStateStore;
|
|
exports.setMuted = setMuted_74575;
|
|
exports.toggleMuted = toggleMuted;
|
|
exports.setVideoStateControls = setVideoStateControls;
|
|
exports.setPausedState = setPausedState;
|
|
exports.tryPauseCurrentVideo = tryPauseCurrentVideo;
|
|
exports.unpauseCurrentVideoIfNeeded = unpauseCurrentVideoIfNeeded;
|
|
function useVideoControls(a0, a1, a2) { // fn#74568, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9737:254, offset: 0x01d924fb, size: 435 bytes, params: 4, frame: 28
|
|
const env0_0 = a0;
|
|
const env0_1 = a2;
|
|
const styles = useStyles();
|
|
const useReducedMotion = (require(566) /* metro dependency 566: flux */).useStateFromStores([AccessibilityStore],
|
|
function() {
|
|
return AccessibilityStore.useReducedMotion;
|
|
});
|
|
let binding = env0_4;
|
|
const [property, property2] = Module00057(binding.useState(false), 2);
|
|
const MediaViewerSourcesStore = (UseMediaViewerSourcesModule).MediaViewerSourcesStore;
|
|
const value4 = MediaViewerSourcesStore.useState(_fun74570);
|
|
var env0_4 = value4;
|
|
const value5 = (UsePrevious)(a0);
|
|
const r1 = a2 != null && (require(9546) /* metro dependency 9546: MediaSourceUtil */).supportOverlayVideoControls(a1);
|
|
const r2 = a1.portal ?? a1.videoURI;
|
|
const value8 = (UsePrevious)(r2);
|
|
binding = env0_4;
|
|
binding.useEffect(_fun74571, [a2, r2, useReducedMotion, value8, value4, value5, a0]);
|
|
if (r1) {
|
|
return ((Component) => <Component style={styles.slider} controls={a2} paused={property} setPaused={property2} onPlayPress={binding.useCallback(_fun74572,
|
|
|
|
[a0])} key={r2} />)(importDefault(9553) /* metro dependency 9553: MediaSlider */);
|
|
}
|
|
function _fun74570({spoilerIndexes}) { // fn#74570, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9737:442, offset: 0x01d926ae, size: 28 bytes, params: 2, frame: 11
|
|
return spoilerIndexes.has(env0_0);
|
|
}
|
|
|
|
function _fun74571() { // fn#74571, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9737:597, offset: 0x01d926ca, size: 103 bytes, params: 1, frame: 12
|
|
var r2;
|
|
if (env0_5 !== env0_0) {
|
|
if (env0_5 != null) {
|
|
if (JsxRuntimeModule.jsx != null) {
|
|
if (env0_7 !== JsxRuntimeModule.jsx) {
|
|
importDefault.seek(0);
|
|
r2 = env0_4 || useReducedMotion;
|
|
importDefault.pause(r2);
|
|
Module00057(r2);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
function _fun74572() { // fn#74572, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9737:715, offset: 0x01d92731, size: 45 bytes, params: 1, frame: 12
|
|
const value = environment.__proto__;
|
|
(UseMediaViewerSourcesModule).removeSpoiler(env0_0);
|
|
}
|
|
|
|
}
|
|
|
|
function initVideoStateStore() { // fn#74573, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9737:982, offset: 0x01d9275e, size: 47 bytes, params: 1, frame: 12
|
|
(ReactBatchUpdatesNativeModule).batchUpdates(_fun74574);
|
|
function _fun74574() { // fn#74574, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9737:1035, offset: 0x01d9278d, size: 36 bytes, params: 1, frame: 13
|
|
env1_7.setState({controls: undefined, paused: false});
|
|
}
|
|
|
|
}
|
|
|
|
function setMuted_74575(a0) { // fn#74575, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9737:1095, offset: 0x01d927b1, size: 54 bytes, params: 2, frame: 12
|
|
const env0_0 = a0;
|
|
(ReactBatchUpdatesNativeModule).batchUpdates(_fun74576);
|
|
function _fun74576() { // fn#74576, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9737:1138, offset: 0x01d927e7, size: 58 bytes, params: 1, frame: 13
|
|
const useMediaPlayerMutedStore = (MediaPlayerMuteManagerModule).useMediaPlayerMutedStore;
|
|
useMediaPlayerMutedStore.setState({isMuted: env0_0});
|
|
}
|
|
|
|
}
|
|
|
|
function toggleMuted() { // fn#74577, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9737:1216, offset: 0x01d92821, size: 47 bytes, params: 1, frame: 12
|
|
(require(690) /* metro dependency 690: ReactBatchUpdatesNative */).batchUpdates(function() {
|
|
var useMediaPlayerMutedStore = require(dependencyMap[6]).useMediaPlayerMutedStore;
|
|
useMediaPlayerMutedStore.setState(_fun74579);
|
|
});
|
|
function _fun74578() { // fn#74578, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9737:1261, offset: 0x01d92850, size: 53 bytes, params: 1, frame: 12
|
|
const useMediaPlayerMutedStore = (MediaPlayerMuteManagerModule).useMediaPlayerMutedStore;
|
|
useMediaPlayerMutedStore.setState(function(a0) {
|
|
return {isMuted: !a0.isMuted};
|
|
});
|
|
}
|
|
|
|
}
|
|
|
|
function setVideoStateControls(a0) { // fn#74580, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9737:1365, offset: 0x01d9289a, size: 54 bytes, params: 2, frame: 12
|
|
const env0_0 = a0;
|
|
(ReactBatchUpdatesNativeModule).batchUpdates(_fun74581);
|
|
function _fun74581() { // fn#74581, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9737:1421, offset: 0x01d928d0, size: 34 bytes, params: 1, frame: 12
|
|
return env1_7.setState({controls: env0_0});
|
|
}
|
|
|
|
}
|
|
|
|
function setPausedState(a0) { // fn#74582, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9737:1470, offset: 0x01d928f2, size: 54 bytes, params: 2, frame: 12
|
|
const env0_0 = a0;
|
|
(ReactBatchUpdatesNativeModule).batchUpdates(_fun74583);
|
|
function _fun74583() { // fn#74583, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9737:1519, offset: 0x01d92928, size: 34 bytes, params: 1, frame: 12
|
|
return env1_7.setState({paused: env0_0});
|
|
}
|
|
|
|
}
|
|
|
|
function tryPauseCurrentVideo() { // fn#74584, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9737:1572, offset: 0x01d9294a, size: 46 bytes, params: 1, frame: 11
|
|
const binding = env0_7;
|
|
const getState = binding.getState;
|
|
const controls = Reflect.apply(getState, binding, []).controls;
|
|
if (controls != null) {
|
|
controls.pause(true);
|
|
}
|
|
}
|
|
|
|
function unpauseCurrentVideoIfNeeded() { // fn#74585, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9737:1686, offset: 0x01d92978, size: 77 bytes, params: 1, frame: 13
|
|
var r1;
|
|
var r3;
|
|
var controls;
|
|
let binding = env0_7;
|
|
const getState = binding.getState;
|
|
const paused = Reflect.apply(getState, binding, []).paused;
|
|
const value2 = undefined;
|
|
if (paused) {
|
|
r1 = paused;
|
|
r3 = value2;
|
|
} else {
|
|
binding = env0_7;
|
|
controls = binding.getState().controls;
|
|
r1 = controls == null;
|
|
r3 = controls;
|
|
}
|
|
if (!r1) {
|
|
r3.pause(false);
|
|
}
|
|
return value2;
|
|
}
|
|
|
|
}
|
|
|
|
function _fun74579({isMuted}) { // fn#74579, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9737:1309, offset: 0x01d92885, size: 21 bytes, params: 2, frame: 2
|
|
return {isMuted: !isMuted};
|
|
}
|
|
|
|
global.__d(_fun74566, 9551, [57, 31, 4502, 33, 629, 690, 9552, 4501, 566, 9545, 6266, 9546, 9553,
|
|
2]) /* metro module 9551, dependencies: [57, 31, 4502, 33, 629, 690, 9552, 4501, 566, 9545, 6266, 9546, 9553, 2] */;
|