361 lines
20 KiB
TypeScript
361 lines
20 KiB
TypeScript
/* Metro module 9543; source: components_native/common/Video.tsx; dependencies: [6, 7, 15, 17, 18, 57, 31, 27, 33, 4501, 697, 8011, 9544, 5459, 1244, 3868, 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 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 ReactNativeModule from '../../by-id/module-00027-ReactNative.js'; /* Metro dependency 27 */
|
|
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 NativeModule from '../../external/discord_common/js/packages/design/native.tsx'; /* Metro dependency 3868 */
|
|
import * as CreateStylesModule from '../../design/components/Styles/native/createStyles.tsx'; /* Metro dependency 4501 */
|
|
import * as Module08011Module from '../../by-id/module-08011.jsx'; /* Metro dependency 8011 */
|
|
|
|
function _fun74450(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#74450, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9729:6, offset: 0x01d8dee8, size: 512 bytes, params: 8, frame: 26
|
|
const env0_0 = require;
|
|
const VideoComponent2 = VideoComponent;
|
|
const Object = global.Object;
|
|
Object.defineProperty(exports, '__esModule', {value: true});
|
|
const env0_2 = ClassCallCheck;
|
|
const env0_3 = CreateClass;
|
|
let value = ReactModule;
|
|
const createLegacyClassComponentStyles = CreateStylesModule.createLegacyClassComponentStyles;
|
|
object = {};
|
|
const object2 = {'flex': 1, 'shadowColor': null, 'shadowOpacity': 0.5, 'shadowOffset': null, 'shadowRadius': 16};
|
|
const BLACK = (importDefault(697) /* metro dependency 697: native */).unsafe_rawColors.BLACK;
|
|
object2.shadowColor = BLACK;
|
|
object2.shadowOffset = {'height': 1, 'width': 0};
|
|
let BACKGROUND_BRAND = (importDefault(697) /* metro dependency 697: native */).colors.BACKGROUND_BRAND;
|
|
object2.backgroundColor = BACKGROUND_BRAND;
|
|
object.container = object2;
|
|
BACKGROUND_BRAND = (importDefault(697) /* metro dependency 697: native */).colors.BACKGROUND_BRAND;
|
|
object.video = {flex: 1, backgroundColor: BACKGROUND_BRAND};
|
|
const env0_14 = Reflect.apply(createLegacyClassComponentStyles, CreateStylesModule, [object]);
|
|
const PureComponent = value.PureComponent;
|
|
value = _fun74458(PureComponent);
|
|
const ThemeContext = (NativeModule).ThemeContext;
|
|
value.contextType = ThemeContext;
|
|
(FileImportTrackerModule).fileFinishedImporting('components_native/common/Video.tsx');
|
|
exports.default = value;
|
|
exports.createVideoControls = createVideoControls;
|
|
exports.VideoComponent = VideoComponent2;
|
|
function _isNativeReflectConstruct_74451() { // fn#74451, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9729:253, offset: 0x01d8e0e8, 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_74451_isNativeReflectConstruct = function() {
|
|
return !!result;
|
|
})();
|
|
}
|
|
|
|
function VideoComponent({style, source, poster, onLoadStart, onLoad, onError, onEnd, paused, muted, posterResizeMode, resizeMode, disableFocus, controls, ariaHidden, mixWithOthers, importantForAccessibility, pauseWhileAppInactive, playInBackground, preventsDisplaySleepDuringVideoPlayback, httpEngine}) { // fn#74454, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9729:737, offset: 0x01d8e14a, size: 456 bytes, params: 2, frame: 38
|
|
paused = !(paused === undefined) && paused;
|
|
muted = muted === undefined || muted;
|
|
posterResizeMode = posterResizeMode === undefined ? 'contain' : posterResizeMode;
|
|
resizeMode = resizeMode === undefined ? 'contain' : resizeMode;
|
|
pauseWhileAppInactive = pauseWhileAppInactive === undefined || pauseWhileAppInactive;
|
|
playInBackground = !(playInBackground === undefined) && playInBackground;
|
|
preventsDisplaySleepDuringVideoPlayback = preventsDisplaySleepDuringVideoPlayback === undefined || preventsDisplaySleepDuringVideoPlayback;
|
|
const property = (Module08011Module).default;
|
|
const binding = env0_8;
|
|
const useState = binding.useState;
|
|
const value11 = Module00057(Reflect.apply(useState, binding, [AppState.currentState === 'active']), 2);
|
|
const property2 = value11[0];
|
|
const env0_1 = value11[1];
|
|
env0_8.useEffect(_fun74455, [pauseWhileAppInactive]);
|
|
const propertyProps = {style: style, source: source, importantForAccessibility: importantForAccessibility,
|
|
poster: poster, muted: muted, paused: paused || pauseWhileAppInactive && !property2,
|
|
posterResizeMode: posterResizeMode, resizeMode: resizeMode, repeat: true, playInBackground: playInBackground,
|
|
pictureInPicture: false, playWhenInactive: false, onLoadStart: onLoadStart, onLoad: onLoad, onError: onError,
|
|
onEnd: onEnd, disableFocus: disableFocus};
|
|
propertyProps['aria-hidden'] = ariaHidden;
|
|
propertyProps.mixWithOthers = mixWithOthers;
|
|
propertyProps.preventsDisplaySleepDuringVideoPlayback = preventsDisplaySleepDuringVideoPlayback;
|
|
propertyProps.httpEngine = httpEngine;
|
|
copyDataProperties(propertyProps, controls?.props, undefined);
|
|
return ((Component) => <Component {...propertyProps} />)(property);
|
|
function _fun74455() { // fn#74455, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9729:1202, offset: 0x01d8e312, size: 59 bytes, params: 1, frame: 14
|
|
var environment;
|
|
if (pauseWhileAppInactive) {
|
|
value = environment.__proto__;
|
|
var env0_0 = AppState.addEventListener('change', _fun74456);
|
|
return _fun74457;
|
|
}
|
|
function _fun74456(a0) { // fn#74456, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9729:1248, offset: 0x01d8e34d, size: 27 bytes, params: 2, frame: 12
|
|
env1_1(a0 === 'active');
|
|
}
|
|
|
|
function _fun74457() { // fn#74457, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9729:1277, offset: 0x00cd0cb3, size: 21 bytes, params: 1, frame: 9
|
|
env0_0.remove();
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
function _fun74458(a0) { // fn#74458, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9729:1663, offset: 0x01d8e368, size: 172 bytes, params: 2, frame: 16
|
|
const Video_744592 = Video_74459;
|
|
Inherits(Video_744592, a0);
|
|
return env0_3(Video_744592, [{key: 'componentDidMount', value: value_74462}, {key: 'componentWillUnmount',
|
|
value: function() {
|
|
if (this._renderTask != null) {
|
|
this._renderTask.cancel();
|
|
}
|
|
}}, {key: 'renderVideo', value: value_74465}, {key: 'renderImage', value: value_74466}, {key: 'render',
|
|
value: value_74467}]);
|
|
function Video_74459(a0) { // fn#74459, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9729:1675, offset: 0x01d8e414, size: 193 bytes, params: 2, frame: 21
|
|
var r0;
|
|
var Reflect;
|
|
let value = copyRestArgs(0, undefined);
|
|
let binding = env1_2;
|
|
binding(this, Video_74459);
|
|
const items2 = [];
|
|
arraySpread(items2, value, 0, items2);
|
|
value = env1_5(Video_74459);
|
|
binding = env1_4;
|
|
if (_isNativeReflectConstruct_74451()) {
|
|
Reflect = global.Reflect;
|
|
value = Reflect.construct(value, items2, env1_5(this).constructor);
|
|
r0 = value;
|
|
} else {
|
|
value = value.apply(this, items2);
|
|
r0 = value;
|
|
}
|
|
value = binding(this, r0);
|
|
value.state = {postponeRender: true};
|
|
value.ref = env1_8.createRef();
|
|
value.isVideo = isVideo_74460;
|
|
value.handleOpenFullScreen = handleOpenFullScreen;
|
|
return value;
|
|
function Video_74459IsVideo() { // fn#74460, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9729:1934, owner: Video_74459.isVideo, offset: 0x01d8e4d5, size: 50 bytes, params: 1, frame: 4
|
|
const src = env0_0.props.src;
|
|
return src != null && 'videoURI' in src && src.videoURI != null;
|
|
}
|
|
|
|
function handleOpenFullScreen() { // fn#74461, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9729:2030, owner: Video_74459.handleOpenFullScreen, offset: 0x01d8e507, size: 153 bytes, params: 1, frame: 17
|
|
var openMediaModal;
|
|
var object2;
|
|
var value;
|
|
const {src, onPress, width, height} = env0_0.props;
|
|
if (onPress != null) {
|
|
onPress();
|
|
}
|
|
const current = env0_0.ref.current;
|
|
if (current != null) {
|
|
value = environment.__proto__.__proto__;
|
|
value = require(9544) /* metro dependency 9544: openMediaModal */;
|
|
openMediaModal = value.openMediaModal;
|
|
object2 = {};
|
|
copyDataProperties(object2, src, width);
|
|
object2['width'] = width;
|
|
object2['height'] = height;
|
|
Reflect.apply(openMediaModal, value, [{initialSources: [object2], originViewOrOriginLayout: current}]);
|
|
}
|
|
}
|
|
|
|
}
|
|
|
|
function value_74462() { // fn#74462, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9729:2288, offset: 0x01d8e5a0, size: 60 bytes, params: 1, frame: 13
|
|
var environment;
|
|
let value = environment.__proto__;
|
|
value = require(5459) /* metro dependency 5459: RunAfterInteractionsUtils */;
|
|
this._renderTask = value.runAfterInteractions(_fun74463);
|
|
function _fun74463() { // fn#74463, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9729:2347, offset: 0x01d8e5dc, size: 31 bytes, params: 1, frame: 12
|
|
env0_0.setState({postponeRender: false});
|
|
}
|
|
|
|
}
|
|
|
|
function value_74465() { // fn#74465, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9729:2514, offset: 0x01d8e61e, size: 242 bytes, params: 1, frame: 27
|
|
var videoURI;
|
|
const value = environment.__proto__;
|
|
const binding = env1_14;
|
|
const context = this.context;
|
|
const value2 = undefined;
|
|
const value3 = binding(context);
|
|
const props = this.props;
|
|
const src = props.src;
|
|
const poster = props.poster;
|
|
const width = props.width;
|
|
const height = props.height;
|
|
const muted = props.muted;
|
|
const paused = props.paused;
|
|
const resizeMode = props.resizeMode;
|
|
if ('videoURI' in src) {
|
|
videoURI = src.videoURI;
|
|
if (videoURI === '') {
|
|
return null;
|
|
}
|
|
videoURI = src.videoURI;
|
|
return (
|
|
videoURI != null
|
|
? (
|
|
<VideoComponent
|
|
style={[value3.video, {width: width, height: height}, props.videoStyle]}
|
|
source={{uri: videoURI}}
|
|
poster={poster}
|
|
muted={muted}
|
|
paused={paused}
|
|
resizeMode={resizeMode}
|
|
posterResizeMode={resizeMode}
|
|
ariaHidden={props.ariaHidden}
|
|
disableFocus={props.disableFocus}
|
|
httpEngine={props.httpEngine}
|
|
/>
|
|
)
|
|
: value2
|
|
);
|
|
}
|
|
return null;
|
|
}
|
|
|
|
function value_74466() { // fn#74466, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9729:3024, offset: 0x01d8e710, size: 115 bytes, params: 1, frame: 17
|
|
var value;
|
|
const props = this.props;
|
|
const src = props.src;
|
|
if ('uri' in src) {
|
|
if (src.uri !== '') {
|
|
value = environment.__proto__;
|
|
return (
|
|
<Image
|
|
source={{uri: src.uri}}
|
|
style={{width: props.width, height: props.height}}
|
|
{...{['aria-hidden']: props.ariaHidden}}
|
|
/>
|
|
);
|
|
}
|
|
}
|
|
}
|
|
|
|
function value_74467() { // fn#74467, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9729:3258, offset: 0x01d8e783, size: 308 bytes, params: 1, frame: 23
|
|
var r7;
|
|
var r0;
|
|
var intl;
|
|
const value = environment.__proto__;
|
|
const value2 = env1_14(this.context);
|
|
const {style, width, height, canOpenFullscreen, postponeRender, accessibilityLabel} = this.props;
|
|
const ref = this.ref;
|
|
const value3 = null;
|
|
const view = (
|
|
<View
|
|
ref={ref}
|
|
style={[value2.container, {width: width, height: height}, style]}
|
|
accessible={value3 != accessibilityLabel}
|
|
accessibilityLabel={accessibilityLabel}
|
|
>
|
|
{this.state.postponeRender && postponeRender !== false ? value3 : this.isVideo() ? this.renderVideo() : this.renderImage()}
|
|
</View>
|
|
);
|
|
if (canOpenFullscreen) {
|
|
if (value3 != accessibilityLabel) {
|
|
r7 = accessibilityLabel;
|
|
} else {
|
|
intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
|
|
r7 = intl.string((require(1244) /* metro dependency 1244: indexNative */).t.OIDkcp);
|
|
}
|
|
r0 = (
|
|
<TouchableWithoutFeedback
|
|
accessibilityRole="button"
|
|
accessibilityLabel={r7}
|
|
onPress={this.handleOpenFullScreen}
|
|
>
|
|
{view}
|
|
</TouchableWithoutFeedback>
|
|
);
|
|
} else {
|
|
r0 = view;
|
|
}
|
|
return r0;
|
|
}
|
|
|
|
}
|
|
|
|
function createVideoControls(a0) { // fn#74468, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9729:3938, offset: 0x01d8e8b7, size: 136 bytes, params: 2, frame: 11
|
|
const env0_0 = a0;
|
|
return {seek: seek_74469, pause: pause_74470, useSubscribe: useSubscribe, props: {ref: env0_8.createRef(),
|
|
onPlaybackRateChange: onPlaybackRateChange, onProgress: onProgress, onDownloadProgress: onDownloadProgress}};
|
|
function createVideoControlsSeek(a0) { // fn#74469, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9729:4020, owner: createVideoControls.seek, offset: 0x01d8e93f, size: 52 bytes, params: 2, frame: 12
|
|
const current = PossibleConstructorReturn.current;
|
|
if (!(current == null || current.seek == null)) {
|
|
current.seek(a0);
|
|
}
|
|
}
|
|
|
|
function createVideoControlsPause(a0) { // fn#74470, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9729:4080, owner: createVideoControls.pause, offset: 0x01d8e973, size: 54 bytes, params: 2, frame: 12
|
|
env0_0(a0);
|
|
if (env0_8 !== a0) {
|
|
if (env0_2 != null) {
|
|
env0_2(a0);
|
|
}
|
|
}
|
|
}
|
|
|
|
function useSubscribe(a0, a1, a2) { // fn#74471, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9729:4122, owner: createVideoControls.useSubscribe, offset: 0x01d8e9a9, size: 60 bytes, params: 4, frame: 13
|
|
env0_1 = a0;
|
|
env0_2 = a1;
|
|
env0_3 = a2;
|
|
env1_8.useLayoutEffect(_fun74472, []);
|
|
function _fun74472() { // fn#74472, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9729:4173, offset: 0x01d8e9e5, size: 83 bytes, params: 1, frame: 15
|
|
if (env1_1 != null) {
|
|
env1_1(env1_5, env1_6);
|
|
}
|
|
if (env1_2 != null) {
|
|
env1_2(env1_8);
|
|
}
|
|
if (env1_3 != null) {
|
|
env1_3(env1_7);
|
|
}
|
|
}
|
|
|
|
}
|
|
|
|
function onPlaybackRateChange({playbackRate}) { // fn#74473, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9729:4242, owner: createVideoControls.onPlaybackRateChange, offset: 0x01d8ea38, size: 59 bytes, params: 2, frame: 11
|
|
if (env0_8 !== (playbackRate === 0)) {
|
|
if (env0_2 != null) {
|
|
env0_2(env0_8);
|
|
}
|
|
}
|
|
}
|
|
|
|
function onProgress({currentTime, seekableDuration}) { // fn#74474, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9729:4319, owner: createVideoControls.onProgress, offset: 0x01d8ea73, size: 60 bytes, params: 2, frame: 13
|
|
if (env0_1 != null) {
|
|
env0_1(currentTime, seekableDuration);
|
|
}
|
|
}
|
|
|
|
function onDownloadProgress({progressPercent}) { // fn#74475, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9729:4387, owner: createVideoControls.onDownloadProgress, offset: 0x01d8eaaf, size: 45 bytes, params: 2, frame: 11
|
|
if (env0_3 != null) {
|
|
env0_3(progressPercent);
|
|
}
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
global.__d(_fun74450, 9543, [6, 7, 15, 17, 18, 57, 31, 27, 33, 4501, 697, 8011, 9544, 5459, 1244, 3868,
|
|
2]) /* metro module 9543, dependencies: [6, 7, 15, 17, 18, 57, 31, 27, 33, 4501, 697, 8011, 9544, 5459, 1244, 3868, 2] */;
|