decord/source/modules/external_pip/ExternalPipViewVideo.android.tsx

221 lines
9 KiB
TypeScript
Raw Normal View History

// Module ID: 16925
// Function ID: 16926
2026-07-20 16:05:17 +00:00
// Name: ExternalPipViewVideoUnavailable
// Dependencies: [32, 19, 17, 1386, 1921, 4502, 21, 4481, 709, 9527, 4436, 4477, 1233, 586, 1296, 9534, 4197, 16926, 9545, 16927, 9539, 2]
2026-07-23 10:11:24 +00:00
// Module 16925 (ExternalPipViewVideoUnavailable)
2026-09-02 09:53:35 +00:00
import initialize from "initialize" /* 586 */;
import ThemesDefault from "Themes" /* 709 */;
import useExternalPipParticipantDefault from "useExternalPipParticipant" /* 16927 */;
2026-08-24 06:08:38 +00:00
import closure_3 from "_slicedToArray" /* 32 */;
import importAllResult from "noop" /* 19 */;
import get_ActivityIndicator from "get ActivityIndicator" /* 17 */;
2026-09-02 09:53:35 +00:00
import closure_8 from "ensureGuildLoaded" /* 1386 */;
import closure_9 from "mergeGuildAvatar" /* 1921 */;
import { ParticipantTypes } from "ParticipantTypes" /* 4502 */;
2026-08-24 06:08:38 +00:00
import jsxProd from "jsxProd" /* 21 */;
import createCacheKey from "createCacheKey" /* 4481 */;
2026-07-20 16:05:17 +00:00
2026-08-24 06:08:38 +00:00
require = arg1;
2026-07-20 16:05:17 +00:00
function ExternalPipViewVideoUnavailable(wasStream) {
wasStream = wasStream.wasStream;
2026-07-29 08:29:29 +00:00
const tmp = callback3();
let obj = { style: tmp.unavailable, children: null };
2026-07-20 16:05:17 +00:00
if (wasStream) {
2026-07-29 08:29:29 +00:00
obj = { style: null };
obj[0] = tmp.unavaiableImage;
let tmp4Result = tmp4(tmp5(9527).StreamEnded, obj);
2026-07-29 08:29:29 +00:00
let tmp8 = tmp4;
let tmp10 = tmp5;
2026-07-20 16:05:17 +00:00
} else {
tmp4Result = tmp4(tmp5(4436).CircleInformationIcon, {});
2026-07-29 08:29:29 +00:00
tmp8 = tmp4;
tmp10 = tmp5;
2026-07-20 16:05:17 +00:00
}
const items = [tmp4Result, ];
2026-07-29 08:29:29 +00:00
obj = { variant: "text-md/semibold", style: tmp.unavailableText, lineClamp: 1, children: null };
2026-09-02 09:53:35 +00:00
const intl = tmp10(1233).intl;
2026-07-20 16:05:17 +00:00
if (wasStream) {
2026-09-02 09:53:35 +00:00
let result = intl.formatToMarkdownString(tmp10(1233).t["1Ww0Hi"], {});
2026-07-20 16:05:17 +00:00
} else {
2026-09-02 09:53:35 +00:00
result = intl.string(tmp10(1233).t.Nzo5nz);
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
obj[3] = result;
items[1] = tmp8(tmp10(4477).Text, obj);
2026-07-29 08:29:29 +00:00
obj[1] = items;
2026-07-20 16:05:17 +00:00
return closure_12(closure_6, obj);
}
function ExternalPipViewVideoUser(arg0) {
2026-07-23 10:11:24 +00:00
({ userId: require, channelId: importDefault, speaking } = arg0);
2026-08-24 06:08:38 +00:00
let obj = initialize;
const items = [closure_9];
const stateFromStores = obj.useStateFromStores(items, () => closure_1_9.getUser(closure_0));
initialize;
[][0] = closure_8;
2026-07-29 08:29:29 +00:00
obj = { style: callback3().user, children: null };
let tmp7Result = null;
2026-07-20 16:05:17 +00:00
if (null != stateFromStores) {
2026-07-29 08:29:29 +00:00
obj = { user: null, avatarDecoration: null, guildId: null, size: null, animate: null, speaking: null };
obj[0] = stateFromStores;
obj[1] = stateFromStores.avatarDecoration;
obj[2] = tmp6;
2026-09-02 09:53:35 +00:00
obj[3] = tmp2(1296).AvatarSizes.XXLARGE;
2026-07-29 08:29:29 +00:00
obj[4] = speaking;
obj[5] = speaking;
2026-09-02 09:53:35 +00:00
tmp7Result = tmp7(tmp2(1296).Avatar, obj);
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
obj[1] = tmp7Result;
return closure_11(closure_6, obj);
2026-07-20 16:05:17 +00:00
}
function ExternalPipViewVideoStream(streamId) {
streamId = streamId.streamId;
2026-07-29 08:29:29 +00:00
let first;
2026-08-24 06:08:38 +00:00
dependencyMap = undefined;
2026-07-29 08:29:29 +00:00
let callback;
let obj = streamId(9534);
2026-07-29 08:29:29 +00:00
first = 300;
2026-08-24 06:08:38 +00:00
dependencyMap = undefined;
2026-07-29 08:29:29 +00:00
callback = undefined;
2026-08-24 06:08:38 +00:00
importAllResult = undefined;
2026-07-20 16:05:17 +00:00
const surfaceDirectRendererExperiment = obj.useSurfaceDirectRendererExperiment(streamId.userId, { location: "ExternalPipViewVideoStream" });
2026-07-29 08:29:29 +00:00
const tmp2 = callback(importAllResult.useState(undefined), 2);
first = tmp2[0];
2026-08-24 06:08:38 +00:00
dependencyMap = first;
2026-07-29 08:29:29 +00:00
callback = tmp2[1];
const tmp4 = callback(importAllResult.useState(false), 2);
importAllResult = tmp4[1];
let items = [streamId];
const items1 = [first, 300];
callback = importAllResult.useCallback(() => value(streamId), items);
const effect = importAllResult.useEffect(() => {
2026-08-24 06:08:38 +00:00
if (null == closure_2) {
2026-07-29 08:29:29 +00:00
const _setTimeout = setTimeout;
const timeout = setTimeout(() => {
callback(true);
}, first);
return () => {
clearTimeout(closure_0);
};
} else {
callback(false);
}
}, items1);
const tmp7 = callback3();
2026-08-24 06:08:38 +00:00
dependencyMap = tmp7;
2026-07-29 08:29:29 +00:00
const items2 = [tmp7, first];
2026-07-20 16:05:17 +00:00
const memo = importAllResult.useMemo(() => {
2026-08-24 06:08:38 +00:00
const items = [video.video, ];
2026-07-20 16:05:17 +00:00
let num = 1;
2026-07-29 08:29:29 +00:00
if (null == first) {
2026-07-20 16:05:17 +00:00
num = 0;
}
2026-07-29 08:29:29 +00:00
items[1] = { opacity: num };
2026-07-20 16:05:17 +00:00
return items;
2026-07-29 08:29:29 +00:00
}, items2);
2026-09-02 09:53:35 +00:00
const token = streamId(4197).useToken(first(709).colors.TEXT_FEEDBACK_INFO);
2026-07-20 16:05:17 +00:00
const value = closure_7.get();
2026-07-29 08:29:29 +00:00
callback = value;
const items3 = [streamId, value];
const callback1 = importAllResult.useCallback((nativeEvent) => {
2026-07-20 16:05:17 +00:00
if (null != streamId) {
({ width, height } = nativeEvent.nativeEvent.layout);
2026-08-24 06:08:38 +00:00
let obj = streamId(video[17]);
2026-07-29 08:29:29 +00:00
obj = { width: null, height: null };
2026-08-24 06:08:38 +00:00
obj[0] = width * closure_3;
obj[1] = height * closure_3;
2026-07-29 08:29:29 +00:00
obj.updateVideoSize(tmp, obj, 1);
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
}, items3);
const children = [callback2(first(9545), { useSurfaceDirectRenderer: surfaceDirectRendererExperiment, style: memo, streamId, onReady: callback, onLayout: callback1 }), ];
2026-07-29 08:29:29 +00:00
let tmp14Result = null;
if (null == first) {
tmp14Result = null;
if (tmp4[0]) {
obj = { style: null, children: null };
obj[0] = tmp7.videoUnavailableWrap;
obj = { style: null, size: "large", color: null };
obj[0] = tmp7.videoUnavailableSpinner;
obj[2] = token;
obj[1] = tmp14(closure_5, obj);
tmp14Result = tmp14(closure_6, obj);
2026-07-20 16:05:17 +00:00
}
}
2026-07-29 08:29:29 +00:00
children[1] = tmp14Result;
return closure_12(closure_13, { children });
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
let c4 = importAllResult;
({ ActivityIndicator: c5, StyleSheet, View: closure_6, PixelRatio: error } = get_ActivityIndicator);
({ jsx: unpackModuleId, jsxs: closure_12, Fragment: map1 } = jsxProd);
let obj = { container: null, video: null, videoUnavailableWrap: null, videoUnavailableSpinner: null, unavailable: null, unavailableText: null, unavaiableImage: null, user: null };
2026-07-20 16:05:17 +00:00
obj = {};
const merged = Object.assign(StyleSheet.absoluteFillObject);
2026-08-24 06:08:38 +00:00
obj.backgroundColor = ThemesDefault.colors.BACKGROUND_SURFACE_HIGH;
2026-07-29 08:29:29 +00:00
obj[0] = obj;
createCacheKey = {};
2026-07-20 16:05:17 +00:00
const merged1 = Object.assign(StyleSheet.absoluteFillObject);
2026-07-29 08:29:29 +00:00
obj[1] = createCacheKey;
2026-07-20 16:05:17 +00:00
const obj2 = {};
const merged2 = Object.assign(StyleSheet.absoluteFillObject);
2026-08-24 06:08:38 +00:00
obj2.margin = ThemesDefault.space.PX_16;
obj2.borderRadius = ThemesDefault.radii.sm;
2026-07-29 08:29:29 +00:00
obj2.justifyContent = "center";
obj2.alignContent = "center";
obj2.flexDirection = "row";
obj2.alignItems = "center";
obj2.flexWrap = "wrap";
obj2.flex = 1;
obj[2] = obj2;
2026-08-24 06:08:38 +00:00
obj[3] = { marginTop: ThemesDefault.space.PX_16 };
const obj3 = { marginTop: ThemesDefault.space.PX_16 };
obj[4] = { backgroundColor: ThemesDefault.colors.BACKGROUND_SURFACE_HIGH, borderRadius: ThemesDefault.radii.sm, padding: ThemesDefault.space.PX_8, margin: ThemesDefault.space.PX_8, justifyContent: "center", alignContent: "center", alignItems: "center", flexDirection: "row", flexWrap: "wrap", flex: 1 };
const obj4 = { backgroundColor: ThemesDefault.colors.BACKGROUND_SURFACE_HIGH, borderRadius: ThemesDefault.radii.sm, padding: ThemesDefault.space.PX_8, margin: ThemesDefault.space.PX_8, justifyContent: "center", alignContent: "center", alignItems: "center", flexDirection: "row", flexWrap: "wrap", flex: 1 };
obj[5] = { marginLeft: ThemesDefault.space.PX_4, textAlign: "center" };
const obj5 = { marginLeft: ThemesDefault.space.PX_4, textAlign: "center" };
obj[6] = { marginBottom: ThemesDefault.space.PX_8, resizeMode: "contain", aspectRatio: 2.5, width: "80%" };
2026-07-20 16:05:17 +00:00
const obj7 = {};
const merged3 = Object.assign(StyleSheet.absoluteFillObject);
2026-08-24 06:08:38 +00:00
obj7.backgroundColor = ThemesDefault.colors.BACKGROUND_BASE_LOWEST;
obj7.borderRadius = ThemesDefault.radii.sm;
obj7.margin = ThemesDefault.space.PX_8;
2026-07-29 08:29:29 +00:00
obj7.alignItems = "center";
obj7.justifyContent = "center";
obj[7] = obj7;
let closure_14 = createCacheKey.createStyles(obj);
2026-08-24 06:08:38 +00:00
const obj6 = { marginBottom: ThemesDefault.space.PX_8, resizeMode: "contain", aspectRatio: 2.5, width: "80%" };
2026-07-20 16:05:17 +00:00
const memoResult = importAllResult.memo(function ExternalPipViewVideo(onLayout) {
2026-08-24 06:08:38 +00:00
const tmp2 = useExternalPipParticipantDefault();
2026-07-20 16:05:17 +00:00
({ selectedParticipantStreamId, selectedParticipantUserId, focusedParticipantType } = tmp2);
const items = [selectedParticipantStreamId, selectedParticipantUserId, focusedParticipantType];
({ channelId, selectedParticipantSpeaking } = tmp2);
const effect = importAllResult.useEffect(() => {
2026-07-29 08:29:29 +00:00
callback(table[20]).refreshPipUi();
2026-07-20 16:05:17 +00:00
}, items);
2026-07-29 08:29:29 +00:00
let obj = { style: callback3().container, onLayout: onLayout.onLayout, children: null };
2026-07-20 16:05:17 +00:00
if (null != selectedParticipantStreamId) {
2026-07-29 08:29:29 +00:00
obj = { streamId: null, userId: null };
obj[0] = selectedParticipantStreamId;
obj[1] = selectedParticipantUserId;
let tmp4Result = tmp4(ExternalPipViewVideoStream, obj);
2026-07-20 16:05:17 +00:00
} else if (null != selectedParticipantUserId) {
2026-07-29 08:29:29 +00:00
obj = { userId: null, channelId: null, speaking: null };
obj[0] = selectedParticipantUserId;
obj[1] = channelId;
obj[2] = selectedParticipantSpeaking;
tmp4Result = tmp4(ExternalPipViewVideoUser, obj);
2026-07-20 16:05:17 +00:00
} else {
2026-07-29 08:29:29 +00:00
let tmp7 = focusedParticipantType === ParticipantTypes.STREAM;
if (!tmp7) {
tmp7 = focusedParticipantType === ParticipantTypes.HIDDEN_STREAM;
2026-07-20 16:05:17 +00:00
}
2026-08-24 06:08:38 +00:00
obj1 = { wasStream: null };
2026-07-29 08:29:29 +00:00
obj1[0] = tmp7;
tmp4Result = tmp4(ExternalPipViewVideoUnavailable, obj1);
const tmp6 = ExternalPipViewVideoUnavailable;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
obj[2] = tmp4Result;
return closure_11(closure_6, obj);
2026-07-20 16:05:17 +00:00
});
2026-08-24 06:08:38 +00:00
let result = require("set").fileFinishedImporting("modules/external_pip/ExternalPipViewVideo.android.tsx");
2026-07-20 16:05:17 +00:00
export default memoResult;