decord/source/modules/quests/native/VideoQuestModal/VideoQuestPlayer.tsx

1140 lines
41 KiB
TypeScript
Raw Normal View History

2026-08-24 06:08:38 +00:00
// Module ID: 14556
// Function ID: 14557
2026-07-29 08:29:29 +00:00
// Name: hasVideoEnded
2026-08-24 06:08:38 +00:00
// Dependencies: [32, 19, 17, 7421, 7493, 6753, 676, 21, 712, 9056, 4668, 689, 14546, 10723, 10525, 4009, 4119, 4749, 4753, 4671, 4674, 14554, 7514, 14557, 1626, 500, 1231, 10743, 10516, 589, 1208, 1629, 1236, 14565, 5438, 14449, 14451, 14453, 14454, 10162, 9040, 9042, 14455, 14456, 2]
2026-07-23 10:11:24 +00:00
2026-08-24 06:08:38 +00:00
// Module 14556 (hasVideoEnded)
import ThemesDefault from "Themes" /* 712 */;
import _isNativeReflectConstructDefault from "_isNativeReflectConstruct" /* 9056 */;
import closure_3 from "_slicedToArray" /* 32 */;
import importAllResult from "noop" /* 19 */;
import get_ActivityIndicator from "get ActivityIndicator" /* 17 */;
import closure_8 from "getState" /* 7421 */;
import closure_9 from "_toPropertyKey" /* 7493 */;
import { QuestsExperimentLocations } from "QuestsExperimentLocations" /* 6753 */;
import ME from "ME" /* 676 */;
import jsxProd from "jsxProd" /* 21 */;
import createCacheKey from "createCacheKey" /* 4668 */;
import importDefaultResult from "n" /* 689 */;
2026-07-20 16:05:17 +00:00
2026-07-23 10:11:24 +00:00
const require = arg1;
2026-07-29 08:29:29 +00:00
let c4 = importAllResult;
({ View: c5, StyleSheet, Pressable: closure_6, ActivityIndicator: error } = get_ActivityIndicator);
({ AppStates: unpackModuleId, ComponentActions: closure_12 } = ME);
({ jsx: map1, jsxs: closure_14 } = jsxProd);
2026-08-24 06:08:38 +00:00
let obj = { left: ThemesDefault.space.PX_16, right: ThemesDefault.space.PX_16, top: ThemesDefault.space.PX_16, bottom: ThemesDefault.space.PX_16 };
let closure_16 = importAllResult.memo(_isNativeReflectConstructDefault);
2026-07-29 08:29:29 +00:00
function hasVideoEnded(arg0, arg1) {
return arg0 >= arg1 - 1;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
hasVideoEnded.__closure = {};
hasVideoEnded.__workletHash = 3281537893520;
hasVideoEnded.__initData = { code: "function hasVideoEnded_VideoQuestPlayerTsx1(currentTime,videoDuration){return currentTime>=videoDuration-1;}" };
function canSeekForward(arg0, arg1, arg2, arg3) {
2026-08-04 21:03:28 +00:00
if (typeof hasVideoEnded !== "function") {
2026-07-29 08:29:29 +00:00
HermesBuiltin.throwTypeError();
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
let tmp2 = !tmp;
if (arg0 < arg2 - 1) {
let tmp3 = arg3;
if (!arg3) {
tmp3 = arg0 <= arg1 - 1;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
tmp2 = tmp3;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
return tmp2;
}
canSeekForward.__closure = { hasVideoEnded };
canSeekForward.__workletHash = 741911733910;
canSeekForward.__initData = { code: "function canSeekForward_VideoQuestPlayerTsx2(currentTime,maxTimestamp,videoDuration,isQuestCompleted){const{hasVideoEnded}=this.__closure;return!hasVideoEnded(currentTime,videoDuration)&&(isQuestCompleted||currentTime<=maxTimestamp-1);}" };
obj = { container: null, loadingContainer: null, bufferingSpinner: null, bufferingSpinnerCentered: null, video: null, videoContainer: null, controls: null, controlsTopBottom: null, controlsMiddle: null, controlsTop: null, controlsBottom: null, progressContainer: null, progress: null, icon: null, iconDisabled: null, controlButton: null };
2026-07-20 16:05:17 +00:00
const merged = Object.assign(StyleSheet.absoluteFillObject);
2026-07-29 08:29:29 +00:00
obj[0] = {};
createCacheKey = {};
2026-07-20 16:05:17 +00:00
const merged1 = Object.assign(StyleSheet.absoluteFillObject);
2026-08-24 06:08:38 +00:00
createCacheKey.backgroundColor = ThemesDefault.colors.BACKGROUND_BASE_LOWEST;
2026-07-29 08:29:29 +00:00
createCacheKey.justifyContent = "center";
createCacheKey.alignItems = "center";
obj[1] = createCacheKey;
obj[2] = { position: "absolute" };
2026-07-23 10:11:24 +00:00
let obj3 = {};
2026-07-20 16:05:17 +00:00
const merged2 = Object.assign(StyleSheet.absoluteFillObject);
2026-07-29 08:29:29 +00:00
obj3.justifyContent = "center";
obj3.alignItems = "center";
obj[3] = obj3;
obj[4] = { height: "100%", width: "100%" };
obj[5] = { position: "relative", height: "100%", width: "100%" };
2026-07-23 10:11:24 +00:00
let obj4 = {};
2026-07-20 16:05:17 +00:00
const merged3 = Object.assign(StyleSheet.absoluteFillObject);
2026-07-23 10:11:24 +00:00
let obj1 = {};
2026-08-24 06:08:38 +00:00
const importDefaultResultResult = importDefaultResult(ThemesDefault.unsafe_rawColors.BLACK);
obj4.backgroundColor = importDefaultResult(ThemesDefault.unsafe_rawColors.BLACK).alpha(0.5).hex();
2026-07-29 08:29:29 +00:00
obj4.justifyContent = "center";
obj4.alignItems = "center";
obj4.flexDirection = "column";
obj[6] = obj4;
2026-08-24 06:08:38 +00:00
const alphaResult = importDefaultResult(ThemesDefault.unsafe_rawColors.BLACK).alpha(0.5);
obj[7] = { flexDirection: "row", justifyContent: "flex-end", padding: ThemesDefault.space.PX_8, position: "absolute", left: 0, right: 0 };
let obj5 = { flexDirection: "row", justifyContent: "flex-end", padding: ThemesDefault.space.PX_8, position: "absolute", left: 0, right: 0 };
obj[8] = { justifyContent: "center", alignItems: "center", flexGrow: 1, flexDirection: "row", gap: ThemesDefault.space.PX_24, pointerEvents: "box-none" };
2026-07-29 08:29:29 +00:00
obj[9] = { top: 0 };
obj[10] = { bottom: 0 };
2026-08-24 06:08:38 +00:00
let obj6 = { justifyContent: "center", alignItems: "center", flexGrow: 1, flexDirection: "row", gap: ThemesDefault.space.PX_24, pointerEvents: "box-none" };
obj[11] = { position: "absolute", bottom: 0, right: 0, left: 0, justifyContent: "flex-end", height: ThemesDefault.space.PX_16, overflow: "hidden" };
let obj7 = { position: "absolute", bottom: 0, right: 0, left: 0, justifyContent: "flex-end", height: ThemesDefault.space.PX_16, overflow: "hidden" };
obj[12] = { height: 1, backgroundColor: ThemesDefault.colors.WHITE, shadowOffset: { width: 0, height: 0 }, shadowRadius: 6, shadowOpacity: 1, elevation: 5, shadowColor: "#FFFFFF" };
let obj8 = { height: 1, backgroundColor: ThemesDefault.colors.WHITE, shadowOffset: { width: 0, height: 0 }, shadowRadius: 6, shadowOpacity: 1, elevation: 5, shadowColor: "#FFFFFF" };
obj[13] = { color: ThemesDefault.colors.TEXT_DEFAULT };
let obj9 = { color: ThemesDefault.colors.TEXT_DEFAULT };
obj[14] = { color: ThemesDefault.colors.TEXT_SUBTLE };
let obj10 = { color: ThemesDefault.colors.TEXT_SUBTLE };
obj[15] = { padding: ThemesDefault.space.PX_8 };
2026-07-29 08:29:29 +00:00
let closure_19 = createCacheKey.createStyles(obj);
2026-07-23 10:11:24 +00:00
let obj12 = { PAUSED: "paused", PLAYING: "playing", ENDED: "ended", LOADING: "loading", ERRORED: "errored" };
2026-07-29 08:29:29 +00:00
let closure_21 = { code: "function shouldShowControls_VideoQuestPlayerTsx3(){const{hasLoaded,showControls,playerState,PlayerState,isVideoEnded,externallyPaused}=this.__closure;return hasLoaded&&(showControls.get()||playerState===PlayerState.PAUSED||playerState===PlayerState.ENDED||playerState===PlayerState.ERRORED||isVideoEnded||externallyPaused);}" };
let closure_22 = { code: "function VideoQuestPlayerTsx4(){const{shouldShowControls,withSpring,SUBTLE_SPRING}=this.__closure;const show=shouldShowControls();return{opacity:withSpring(show?1:0,SUBTLE_SPRING),pointerEvents:show?'auto':'none'};}" };
let closure_23 = { code: "function VideoQuestPlayerTsx5(){const{withTiming,progress,timingFast}=this.__closure;return{width:withTiming(progress.get()*100+\"%\",timingFast,'animate-always')};}" };
2026-08-24 06:08:38 +00:00
let obj11 = { padding: ThemesDefault.space.PX_8 };
2026-07-20 16:05:17 +00:00
const memoResult = importAllResult.memo((onLoad) => {
onLoad = onLoad.onLoad;
2026-07-29 08:29:29 +00:00
handleBufferAnalytics = onLoad;
2026-07-20 16:05:17 +00:00
const onEnd = onLoad.onEnd;
2026-07-29 08:29:29 +00:00
let ref1 = onEnd;
2026-07-20 16:05:17 +00:00
const onToggleFullscreen = onLoad.onToggleFullscreen;
2026-08-24 06:08:38 +00:00
dependencyMap = onToggleFullscreen;
2026-07-29 08:29:29 +00:00
orientation = onLoad.orientation;
2026-07-20 16:05:17 +00:00
({ contentInsets, isFullscreen, externallyPaused } = onLoad);
let flag = onLoad.captionsEnabled;
({ style, handleToggleCaptions, handleOpenTranscript } = onLoad);
if (flag === undefined) {
flag = false;
}
({ hasCaptionAsset, sourceQuestContent } = onLoad);
if (hasCaptionAsset === undefined) {
hasCaptionAsset = true;
}
let flag2 = onLoad.hasTranscriptAsset;
if (flag2 === undefined) {
flag2 = true;
}
let ref;
let quest;
let questTaskDetails;
2026-08-24 06:08:38 +00:00
closure_8 = undefined;
2026-07-23 10:11:24 +00:00
let memo;
let memo1;
2026-07-20 16:05:17 +00:00
let first;
2026-08-24 06:08:38 +00:00
closure_12 = undefined;
2026-07-20 16:05:17 +00:00
let targetSeconds;
2026-08-24 06:08:38 +00:00
closure_14 = undefined;
obj = undefined;
2026-07-23 10:11:24 +00:00
let first1;
2026-08-24 06:08:38 +00:00
closure_17 = undefined;
closure_18 = undefined;
2026-07-23 10:11:24 +00:00
let first2;
2026-08-24 06:08:38 +00:00
obj12 = undefined;
closure_21 = undefined;
closure_22 = undefined;
closure_23 = undefined;
closure_24 = undefined;
closure_25 = undefined;
2026-07-23 10:11:24 +00:00
let sharedValue;
2026-07-29 08:29:29 +00:00
let shouldShowControls;
2026-07-20 16:05:17 +00:00
let sharedValue1;
2026-08-24 06:08:38 +00:00
closure_29 = undefined;
2026-07-29 08:29:29 +00:00
handleEndAnalytics = undefined;
2026-07-20 16:05:17 +00:00
let handleErrorAnalytics;
let handleLoadAnalytics;
let handleLoadStartAnalytics;
let handlePausePlaybackAnalytics;
let handleProgressAnalytics;
let handleReadyForDisplayAnalytics;
let handleResumePlaybackAnalytics;
let handleSeekAnalytics;
2026-07-29 08:29:29 +00:00
ref1 = undefined;
2026-07-20 16:05:17 +00:00
let id;
let gameTitle;
let url1;
let videoTitle;
let str;
2026-07-29 08:29:29 +00:00
c45 = undefined;
let callback2;
2026-07-23 10:11:24 +00:00
let callback4;
2026-07-20 16:05:17 +00:00
let callback6;
let callback7;
2026-08-24 06:08:38 +00:00
closure_50 = undefined;
2026-07-20 16:05:17 +00:00
let ref2;
let ref3;
2026-07-29 08:29:29 +00:00
let callback18;
let tmp = first2();
obj = externallyPaused;
2026-07-23 10:11:24 +00:00
ref = externallyPaused.useRef(null);
2026-08-24 06:08:38 +00:00
obj1 = handleBufferAnalytics(14546);
2026-07-29 08:29:29 +00:00
const videoQuestModalContext = obj1.useVideoQuestModalContext();
2026-07-20 16:05:17 +00:00
quest = videoQuestModalContext.quest;
2026-08-24 06:08:38 +00:00
let obj2 = handleBufferAnalytics(10723);
2026-07-29 08:29:29 +00:00
questTaskDetails = obj2.useQuestTaskDetails(quest);
2026-07-20 16:05:17 +00:00
const userStatus = quest.userStatus;
let completedAt;
2026-07-29 08:29:29 +00:00
if (userStatus != null) {
2026-07-20 16:05:17 +00:00
completedAt = userStatus.completedAt;
}
2026-07-29 08:29:29 +00:00
let tmp8 = null != completedAt;
2026-08-24 06:08:38 +00:00
closure_8 = tmp8;
2026-07-23 10:11:24 +00:00
let items = [quest];
2026-07-29 08:29:29 +00:00
memo = obj.useMemo(() => handleBufferAnalytics(ref[14]).getQuestAsset(quest, handleBufferAnalytics(ref[14]).QuestAssetType.VIDEO_PLAYER_VIDEO, undefined, true), items);
2026-07-23 10:11:24 +00:00
let items1 = [quest];
2026-07-29 08:29:29 +00:00
memo1 = obj.useMemo(() => handleBufferAnalytics(ref[14]).getQuestAsset(quest, handleBufferAnalytics(ref[14]).QuestAssetType.VIDEO_PLAYER_VIDEO_HLS, undefined, true), items1);
2026-07-20 16:05:17 +00:00
let url;
2026-07-29 08:29:29 +00:00
if (memo1 != null) {
2026-07-20 16:05:17 +00:00
url = memo1.url;
}
if (null != url) {
2026-08-24 06:08:38 +00:00
let VIDEO_PLAYER_VIDEO = tmp3(10525).QuestAssetType.VIDEO_PLAYER_VIDEO_HLS;
2026-07-20 16:05:17 +00:00
} else {
2026-08-24 06:08:38 +00:00
VIDEO_PLAYER_VIDEO = tmp3(10525).QuestAssetType.VIDEO_PLAYER_VIDEO;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
const tmp13 = orientation(obj.useState(questTaskDetails.targetSeconds), 2);
first = tmp13[0];
closure_12 = tmp13[1];
2026-07-20 16:05:17 +00:00
targetSeconds = questTaskDetails.targetSeconds;
2026-07-29 08:29:29 +00:00
const tmp15 = memo((setVideoProgress) => setVideoProgress.setVideoProgress);
2026-08-24 06:08:38 +00:00
closure_14 = tmp15;
2026-07-29 08:29:29 +00:00
const tmp16 = memo((arg0) => {
2026-07-23 10:11:24 +00:00
let tmp = arg0.videoProgress[quest.id];
2026-07-29 08:29:29 +00:00
if (tmp == null) {
2026-08-24 06:08:38 +00:00
obj = { timestampSec: null, duration: null, maxTimestampSec: null };
2026-07-29 08:29:29 +00:00
obj[0] = questTaskDetails.progressSeconds;
obj[1] = first;
obj[2] = questTaskDetails.progressSeconds;
2026-07-20 16:05:17 +00:00
tmp = obj;
}
return tmp;
2026-08-24 06:08:38 +00:00
}, handleBufferAnalytics(4009).shallow);
2026-07-29 08:29:29 +00:00
obj = tmp16;
const tmp18 = orientation(obj.useState(obj12.LOADING), 2);
2026-07-23 10:11:24 +00:00
first1 = tmp18[0];
2026-07-20 16:05:17 +00:00
closure_17 = tmp18[1];
2026-07-29 08:29:29 +00:00
closure_18 = obj.useRef(false);
const tmp20 = orientation(obj.useState(false), 2);
2026-07-23 10:11:24 +00:00
first2 = tmp20[0];
2026-07-29 08:29:29 +00:00
obj12 = tmp20[1];
closure_21 = obj.useRef(questTaskDetails.progressSeconds);
closure_22 = obj.useRef([]);
closure_23 = obj.useRef(null);
closure_24 = obj.useRef(0);
let tmp22 = first2;
2026-07-20 16:05:17 +00:00
if (first2) {
2026-07-29 08:29:29 +00:00
tmp22 = first1 === tmp17.ENDED;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
if (tmp22) {
({ timestampSec, duration } = tmp16);
2026-08-04 21:03:28 +00:00
if (typeof closure_17 !== "function") {
2026-07-29 08:29:29 +00:00
HermesBuiltin.throwTypeError();
}
tmp22 = timestampSec >= duration - 1;
2026-07-20 16:05:17 +00:00
}
2026-08-24 06:08:38 +00:00
closure_25 = tmp22;
let tmp3Result = tmp3(4119);
2026-07-29 08:29:29 +00:00
sharedValue = tmp3Result.useSharedValue(false);
shouldShowControls = function shouldShowControls() {
let tmp = first2;
if (first2) {
let value = sharedValue.get();
if (!value) {
value = first1 === lib2.PAUSED;
}
if (!value) {
value = first1 === lib2.ENDED;
}
if (!value) {
value = first1 === lib2.ERRORED;
}
if (!value) {
2026-08-24 06:08:38 +00:00
value = closure_25;
2026-07-29 08:29:29 +00:00
}
if (!value) {
value = externallyPaused;
}
tmp = value;
}
return tmp;
};
shouldShowControls.__closure = { hasLoaded: first2, showControls: sharedValue, playerState: first1, PlayerState: obj12, isVideoEnded: tmp22, externallyPaused };
shouldShowControls.__workletHash = 11602236169344;
shouldShowControls.__initData = closure_21;
2026-08-24 06:08:38 +00:00
tmp3Result = tmp3(4119);
2026-07-29 08:29:29 +00:00
class G {
constructor() {
2026-08-04 21:03:28 +00:00
if (typeof shouldShowControls !== "function") {
2026-07-29 08:29:29 +00:00
str2 = "Trying to call a non-function";
throwTypeErrorResult = HermesBuiltin.throwTypeError();
}
2026-08-24 06:08:38 +00:00
tmp = closure_19;
if (closure_19) {
tmp2 = closure_26;
value = closure_26.get();
2026-07-20 16:05:17 +00:00
if (!value) {
2026-08-24 06:08:38 +00:00
tmp4 = closure_16;
tmp5 = closure_20;
value = closure_16 === closure_20.PAUSED;
2026-07-20 16:05:17 +00:00
}
if (!value) {
2026-08-24 06:08:38 +00:00
tmp6 = closure_16;
tmp7 = closure_20;
value = closure_16 === closure_20.ENDED;
2026-07-20 16:05:17 +00:00
}
if (!value) {
2026-08-24 06:08:38 +00:00
tmp8 = closure_16;
tmp9 = closure_20;
value = closure_16 === closure_20.ERRORED;
2026-07-20 16:05:17 +00:00
}
if (!value) {
2026-08-24 06:08:38 +00:00
value = closure_25;
2026-07-20 16:05:17 +00:00
}
if (!value) {
2026-07-29 08:29:29 +00:00
value = externallyPaused;
2026-07-20 16:05:17 +00:00
}
tmp = value;
}
2026-07-29 08:29:29 +00:00
tmp10 = handleBufferAnalytics;
2026-08-24 06:08:38 +00:00
tmp11 = closure_2;
obj = handleBufferAnalytics(closure_2[17]);
2026-07-20 16:05:17 +00:00
num = 0;
if (tmp) {
num = 1;
}
2026-07-29 08:29:29 +00:00
obj = { opacity: obj.withSpring(num, tmp10(tmp11[18]).SUBTLE_SPRING), pointerEvents: null };
2026-07-20 16:05:17 +00:00
str = "none";
if (tmp) {
str = "auto";
}
2026-07-29 08:29:29 +00:00
obj[1] = str;
2026-07-20 16:05:17 +00:00
return obj;
}
}
2026-08-24 06:08:38 +00:00
obj = { shouldShowControls, withSpring: tmp3(4749).withSpring, SUBTLE_SPRING: tmp3(4753).SUBTLE_SPRING };
2026-07-29 08:29:29 +00:00
G.__closure = obj;
G.__workletHash = 6174625876255;
G.__initData = closure_22;
const animatedStyle = tmp3Result.useAnimatedStyle(G);
if (first2) {
first2 = sharedValue.get() || first1 === tmp17.PAUSED || first1 === tmp17.ENDED || first1 === tmp17.ERRORED || tmp22 || externallyPaused;
const tmp25 = sharedValue.get() || first1 === tmp17.PAUSED || first1 === tmp17.ENDED || first1 === tmp17.ERRORED || tmp22 || externallyPaused;
}
2026-08-24 06:08:38 +00:00
sharedValue1 = handleBufferAnalytics(4119).useSharedValue(0);
const tmp3Result1 = handleBufferAnalytics(4119);
2026-07-29 08:29:29 +00:00
class U {
2026-07-20 16:05:17 +00:00
constructor() {
2026-07-29 08:29:29 +00:00
obj = { width: null };
2026-08-24 06:08:38 +00:00
obj2 = handleBufferAnalytics(closure_2[19]);
result = 100 * closure_28.get();
obj[0] = obj2.withTiming(`${tmp}%`, handleBufferAnalytics(closure_2[20]).timingFast, "animate-always");
2026-07-20 16:05:17 +00:00
return obj;
}
}
2026-08-24 06:08:38 +00:00
obj = { withTiming: tmp3(4671).withTiming, progress: sharedValue1, timingFast: tmp3(4674).timingFast };
2026-07-29 08:29:29 +00:00
U.__closure = obj;
U.__workletHash = 4647711667921;
U.__initData = closure_23;
2026-08-24 06:08:38 +00:00
const animatedStyle1 = handleBufferAnalytics(4119).useAnimatedStyle(U);
2026-07-29 08:29:29 +00:00
closure_29 = obj.useRef(-1);
2026-07-20 16:05:17 +00:00
const items2 = [sharedValue];
2026-07-29 08:29:29 +00:00
const callback = obj.useCallback((arg0) => {
2026-08-24 06:08:38 +00:00
closure_0 = arg0;
2026-07-29 08:29:29 +00:00
return () => {
2026-07-20 16:05:17 +00:00
const items = [...arguments];
2026-08-24 06:08:38 +00:00
clearTimeout(closure_1_29.current);
let result = closure_1_26.set(true);
closure_1_29.current = setTimeout(() => {
2026-07-29 08:29:29 +00:00
const result = closure_26.set(false);
2026-07-20 16:05:17 +00:00
}, 2000);
2026-07-23 10:11:24 +00:00
if (null != closure_0) {
2026-07-20 16:05:17 +00:00
const items1 = [];
HermesBuiltin.arraySpread(items, 0);
return HermesBuiltin.apply(items1, undefined);
}
2026-07-29 08:29:29 +00:00
const tmp3 = closure_0;
2026-07-20 16:05:17 +00:00
};
}, items2);
2026-07-29 08:29:29 +00:00
obj1 = { duration: first, isQuestCompleted: tmp8, playerState: first1, questId: quest.id, videoSessionId: videoQuestModalContext.videoSessionId, videoAssetId: VIDEO_PLAYER_VIDEO, sourceQuestContent };
2026-08-24 06:08:38 +00:00
const tmp30 = ref1(14554)(obj1);
2026-07-29 08:29:29 +00:00
({ handleBufferAnalytics, handleEndAnalytics } = tmp30);
handleErrorAnalytics = tmp30.handleErrorAnalytics;
handleLoadAnalytics = tmp30.handleLoadAnalytics;
handleLoadStartAnalytics = tmp30.handleLoadStartAnalytics;
handlePausePlaybackAnalytics = tmp30.handlePausePlaybackAnalytics;
handleProgressAnalytics = tmp30.handleProgressAnalytics;
handleReadyForDisplayAnalytics = tmp30.handleReadyForDisplayAnalytics;
handleResumePlaybackAnalytics = tmp30.handleResumePlaybackAnalytics;
handleSeekAnalytics = tmp30.handleSeekAnalytics;
ref1 = obj.useRef(null);
2026-07-20 16:05:17 +00:00
id = quest.id;
gameTitle = quest.config.messages.gameTitle;
url1 = undefined;
2026-07-29 08:29:29 +00:00
if (memo1 != null) {
2026-07-20 16:05:17 +00:00
url1 = memo1.url;
}
2026-07-29 08:29:29 +00:00
if (url1 == null) {
2026-07-20 16:05:17 +00:00
let url2;
2026-07-29 08:29:29 +00:00
if (memo != null) {
2026-07-20 16:05:17 +00:00
url2 = memo.url;
}
url1 = url2;
}
2026-08-24 06:08:38 +00:00
const tmp3Result2 = handleBufferAnalytics(4119);
const defaultWatchVideoTask = handleBufferAnalytics(7514).getDefaultWatchVideoTask(quest.config);
2026-07-20 16:05:17 +00:00
videoTitle = undefined;
2026-07-29 08:29:29 +00:00
if (defaultWatchVideoTask != null) {
2026-07-20 16:05:17 +00:00
videoTitle = defaultWatchVideoTask.messages.videoTitle;
}
let url3;
2026-07-29 08:29:29 +00:00
if (memo1 != null) {
2026-07-20 16:05:17 +00:00
url3 = memo1.url;
}
str = "mp4";
if (null != url3) {
str = "hls";
}
2026-07-25 08:10:48 +00:00
const items3 = [id, gameTitle, targetSeconds, url1, videoTitle, str];
2026-07-29 08:29:29 +00:00
const effect = obj.useEffect(() => {
2026-07-20 16:05:17 +00:00
if (null != ref.current) {
if (null != url1) {
2026-07-29 08:29:29 +00:00
if (0 !== arr.length) {
2026-08-24 06:08:38 +00:00
obj = handleBufferAnalytics(ref[23]);
2026-07-29 08:29:29 +00:00
obj = { location: null };
obj[0] = memo1.VIDEO_MODAL_MOBILE;
2026-07-20 16:05:17 +00:00
if (obj.getVideoQoEMetricsConfig(obj).externalAnalyticsEnabled) {
2026-07-29 08:29:29 +00:00
const constants = tmp2(tmp3[24]).getConstants();
obj = { videoRef: null, feature: "quests", appVersion: null, releaseChannel: null, contentMetadata: null };
obj[0] = tmp.current;
({ Version: obj4[2], ReleaseChannel: obj4[3] } = constants);
2026-08-24 06:08:38 +00:00
obj1 = { contentId: null, videoStreamType: null, contentType: "quests", durationMs: null, title: null, questId: null, gameName: null };
2026-07-29 08:29:29 +00:00
obj1[0] = arr;
obj1[1] = str;
obj1[3] = 1000 * targetSeconds;
obj1[4] = videoTitle;
obj1[5] = id;
obj1[6] = gameTitle;
obj[4] = obj1;
const mobileMuxWrapper = new tmp2(tmp3[23]).MobileMuxWrapper(obj);
2026-07-20 16:05:17 +00:00
ref1.current = mobileMuxWrapper;
2026-07-23 10:11:24 +00:00
let current = ref1.current;
2026-07-20 16:05:17 +00:00
current.initialize();
return () => {
2026-07-29 08:29:29 +00:00
if (null != ref2.current) {
const current = tmp.current;
current.onProgress(ref.current);
const current2 = tmp.current;
2026-07-20 16:05:17 +00:00
current2.destroy();
2026-07-29 08:29:29 +00:00
tmp.current = null;
2026-07-20 16:05:17 +00:00
}
};
}
}
}
}
}, items3);
2026-07-29 08:29:29 +00:00
let tmp12Result = tmp12(obj.useState(false), 2);
[tmp39, c45] = tmp12Result;
2026-07-20 16:05:17 +00:00
const items4 = [handleReadyForDisplayAnalytics];
2026-07-29 08:29:29 +00:00
const items5 = [tmp16.maxTimestampSec];
const callback1 = obj.useCallback(() => {
2026-07-20 16:05:17 +00:00
handleReadyForDisplayAnalytics();
const current = ref1.current;
2026-07-29 08:29:29 +00:00
if (current != null) {
2026-07-20 16:05:17 +00:00
current.onReadyForDisplay();
}
2026-08-24 06:08:38 +00:00
_undefined(true);
2026-07-20 16:05:17 +00:00
}, items4);
2026-07-29 08:29:29 +00:00
callback2 = obj.useCallback((arg0) => {
let seek = ref;
2026-07-20 16:05:17 +00:00
if (null != ref.current) {
const _Math = Math;
const _Math2 = Math;
2026-08-24 06:08:38 +00:00
const bound = Math.max(0, Math.min(arg0, closure_15.maxTimestampSec));
2026-07-20 16:05:17 +00:00
if (obj.isAndroid()) {
2026-07-29 08:29:29 +00:00
ref5.current = (ref5.current + 1) % 100;
const current2 = seek.current;
seek = current2.seek;
seek(bound + 0.0001 * ref5.current);
2026-07-20 16:05:17 +00:00
} else {
2026-07-29 08:29:29 +00:00
const current = seek.current;
2026-07-20 16:05:17 +00:00
current.seek(bound);
}
closure_23.current = bound;
2026-07-29 08:29:29 +00:00
obj = handleBufferAnalytics(ref[25]);
2026-07-20 16:05:17 +00:00
}
}, items5);
2026-07-29 08:29:29 +00:00
const items6 = [tmp8, tmp16.timestampSec, handleLoadAnalytics, onLoad, callback2];
const items7 = [first1, handlePausePlaybackAnalytics, handleResumePlaybackAnalytics, tmp22, callback2];
const callback3 = obj.useCallback((arg0) => {
2026-07-20 16:05:17 +00:00
({ duration, videoTracks, trackId, naturalSize } = arg0);
lib(duration);
2026-07-29 08:29:29 +00:00
lib2(true);
2026-07-20 16:05:17 +00:00
handleLoadAnalytics();
const current = ref1.current;
2026-07-29 08:29:29 +00:00
if (current != null) {
2026-07-20 16:05:17 +00:00
current.onLoad(duration);
}
if (null != naturalSize) {
2026-07-29 08:29:29 +00:00
const current2 = tmp4.current;
if (current2 != null) {
2026-07-20 16:05:17 +00:00
const result = current2.updateVideoSourceDimensions(naturalSize.width, naturalSize.height);
}
}
let tmp7 = null != videoTracks;
if (tmp7) {
tmp7 = videoTracks.length > 0;
}
if (tmp7) {
tmp7 = null != trackId;
}
if (tmp7) {
tmp7 = trackId.length > 0;
}
if (tmp7) {
2026-07-29 08:29:29 +00:00
const current3 = tmp4.current;
if (current3 != null) {
2026-07-20 16:05:17 +00:00
current3.onVideoTrackChange(trackId, videoTracks);
}
}
if (null != ref.current) {
2026-08-24 06:08:38 +00:00
const timestampSec = closure_15.timestampSec;
let tmp11 = !closure_8;
if (!closure_8) {
2026-07-29 08:29:29 +00:00
tmp11 = timestampSec > 5;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
if (tmp11) {
tmp11 = timestampSec < duration - 3;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
if (tmp11) {
2026-07-20 16:05:17 +00:00
callback2(timestampSec - 1);
}
2026-08-24 06:08:38 +00:00
callback2(lib2.PLAYING);
2026-07-29 08:29:29 +00:00
if (handleBufferAnalytics != null) {
handleBufferAnalytics(arg0);
2026-07-20 16:05:17 +00:00
}
}
}, items6);
2026-07-29 08:29:29 +00:00
callback4 = obj.useCallback(() => {
2026-08-24 06:08:38 +00:00
obj = arg0;
2026-07-20 16:05:17 +00:00
if (arg0 === undefined) {
obj = {};
}
let flag = obj.shouldRestartVideo;
if (flag === undefined) {
flag = true;
}
2026-07-29 08:29:29 +00:00
if (first1 !== lib2.ERRORED) {
if (tmp !== tmp2.PAUSED) {
if (tmp !== tmp2.LOADING) {
if (tmp === tmp2.PLAYING) {
2026-08-24 06:08:38 +00:00
callback2(tmp2.PAUSED);
2026-07-20 16:05:17 +00:00
handlePausePlaybackAnalytics();
const current3 = ref1.current;
2026-07-29 08:29:29 +00:00
if (current3 != null) {
2026-07-20 16:05:17 +00:00
current3.onPause();
}
}
}
}
2026-08-24 06:08:38 +00:00
callback2(tmp2.PLAYING);
2026-07-20 16:05:17 +00:00
handleResumePlaybackAnalytics();
const current = ref1.current;
2026-07-29 08:29:29 +00:00
if (current != null) {
2026-07-20 16:05:17 +00:00
current.onPlay();
}
}
callback2(0);
2026-08-24 06:08:38 +00:00
callback2(lib2.PLAYING);
2026-07-20 16:05:17 +00:00
handleResumePlaybackAnalytics();
const current2 = ref1.current;
2026-07-29 08:29:29 +00:00
if (current2 != null) {
2026-07-20 16:05:17 +00:00
current2.onPlay();
}
}, items7);
const items8 = [callback4];
const items9 = [first1, handlePausePlaybackAnalytics];
2026-07-29 08:29:29 +00:00
const callback5 = obj.useCallback(() => callback4(), items8);
callback6 = obj.useCallback(() => {
2026-07-20 16:05:17 +00:00
closure_18.current = false;
2026-07-29 08:29:29 +00:00
if (first1 === lib2.PLAYING) {
tmp.current = true;
2026-08-24 06:08:38 +00:00
callback2(tmp2.PAUSED);
2026-07-20 16:05:17 +00:00
handlePausePlaybackAnalytics();
const current = ref1.current;
2026-07-29 08:29:29 +00:00
if (current != null) {
2026-07-20 16:05:17 +00:00
current.onPause();
}
}
}, items9);
const items10 = [first1, handleResumePlaybackAnalytics];
2026-07-29 08:29:29 +00:00
callback7 = obj.useCallback(() => {
if (ref2.current) {
tmp.current = false;
if (first1 !== lib2.ERRORED) {
2026-08-24 06:08:38 +00:00
callback2(tmp3.PLAYING);
2026-07-20 16:05:17 +00:00
handleResumePlaybackAnalytics();
const current = ref1.current;
2026-07-29 08:29:29 +00:00
if (current != null) {
2026-07-20 16:05:17 +00:00
current.onPlay();
}
}
}
}, items10);
const items11 = [callback6, callback7];
2026-07-29 08:29:29 +00:00
const effect1 = obj.useEffect(() => {
let ComponentDispatch = handleBufferAnalytics(ref[26]).ComponentDispatch;
2026-07-20 16:05:17 +00:00
const subscription = ComponentDispatch.subscribe(lib.QUEST_GAME_LINK_OPENED, callback6);
2026-07-29 08:29:29 +00:00
let ComponentDispatch2 = handleBufferAnalytics(ref[26]).ComponentDispatch;
2026-07-20 16:05:17 +00:00
const subscription1 = ComponentDispatch2.subscribe(lib.QUEST_APP_STORE_OVERLAY_FINISHED, callback7);
return () => {
2026-08-24 06:08:38 +00:00
const ComponentDispatch = closure_1_0(closure_1_2[26]).ComponentDispatch;
ComponentDispatch.unsubscribe(closure_1_12.QUEST_GAME_LINK_OPENED, closure_48);
const ComponentDispatch2 = closure_1_0(closure_1_2[26]).ComponentDispatch;
ComponentDispatch2.unsubscribe(closure_1_12.QUEST_APP_STORE_OVERLAY_FINISHED, closure_49);
2026-07-20 16:05:17 +00:00
};
}, items11);
const items12 = [onToggleFullscreen, orientation];
const items13 = [sharedValue, callback4];
2026-07-29 08:29:29 +00:00
const callback8 = obj.useCallback(() => {
if (closure_2 != null) {
2026-08-24 06:08:38 +00:00
obj = { orientation: null };
2026-07-29 08:29:29 +00:00
obj[0] = orientation;
tmp(obj);
2026-07-20 16:05:17 +00:00
}
}, items12);
2026-07-29 08:29:29 +00:00
const items14 = [first, sharedValue1, handleSeekAnalytics, quest.id, tmp15];
const callback9 = obj.useCallback(() => {
2026-07-20 16:05:17 +00:00
if (sharedValue.get()) {
const result = sharedValue.set(false);
}
callback4({ shouldRestartVideo: false });
}, items13);
2026-07-29 08:29:29 +00:00
let tmp51 = first1 === tmp17.ERRORED;
const callback10 = obj.useCallback((currentTime) => {
let current = ref3.current;
let arr = current.shift();
if (arr == null) {
arr = null;
2026-07-20 16:05:17 +00:00
}
if (null != ref.current) {
closure_21.current = currentTime.currentTime;
closure_23.current = null;
if (first > 0) {
2026-07-29 08:29:29 +00:00
const result = sharedValue1.set(currentTime.currentTime / tmp15);
2026-08-24 06:08:38 +00:00
callback(quest.id, currentTime.currentTime, tmp15);
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
handleSeekAnalytics(arr, currentTime.currentTime);
2026-07-20 16:05:17 +00:00
current = ref1.current;
2026-07-29 08:29:29 +00:00
if (current != null) {
2026-07-20 16:05:17 +00:00
current.updatePlayheadTime(currentTime.currentTime);
}
const current2 = ref1.current;
2026-07-29 08:29:29 +00:00
if (current2 != null) {
2026-07-20 16:05:17 +00:00
current2.onSeek();
}
2026-07-29 08:29:29 +00:00
const tmp9 = ref1;
2026-07-20 16:05:17 +00:00
}
}, items14);
2026-07-25 08:10:48 +00:00
if (!tmp51) {
2026-07-29 08:29:29 +00:00
({ timestampSec: timestampSec2, maxTimestampSec, duration: duration2 } = tmp16);
2026-08-04 21:03:28 +00:00
if (typeof closure_18 !== "function") {
2026-07-29 08:29:29 +00:00
HermesBuiltin.throwTypeError();
}
2026-08-04 21:03:28 +00:00
if (typeof closure_17 !== "function") {
2026-07-29 08:29:29 +00:00
HermesBuiltin.throwTypeError();
}
let tmp55 = !tmp54;
if (timestampSec2 < duration2 - 1) {
if (!tmp8) {
tmp8 = timestampSec2 <= maxTimestampSec - 1;
}
tmp55 = tmp8;
}
tmp51 = !tmp55;
2026-07-20 16:05:17 +00:00
}
2026-08-24 06:08:38 +00:00
closure_50 = tmp51;
2026-07-25 08:10:48 +00:00
const items15 = [callback2, first, sharedValue1, tmp51];
2026-07-20 16:05:17 +00:00
const items16 = [callback2, first, sharedValue1, first1];
2026-07-29 08:29:29 +00:00
const callback11 = obj.useCallback(() => {
2026-08-24 06:08:38 +00:00
if (!closure_50) {
2026-07-29 08:29:29 +00:00
let current = ref4.current;
if (current == null) {
2026-07-20 16:05:17 +00:00
current = sharedValue1.get() * first;
}
2026-07-29 08:29:29 +00:00
current = ref3.current;
2026-07-20 16:05:17 +00:00
current.push(current);
callback2(current + 10);
}
}, items15);
2026-08-24 06:08:38 +00:00
const tmp3Result3 = handleBufferAnalytics(7514);
2026-07-29 08:29:29 +00:00
const callbackResult = callback(obj.useCallback(() => {
let current = ref4.current;
if (current == null) {
2026-07-20 16:05:17 +00:00
current = sharedValue1.get() * first;
}
2026-07-29 08:29:29 +00:00
current = ref3.current;
2026-07-20 16:05:17 +00:00
current.push(current);
callback2(current - 10);
2026-07-29 08:29:29 +00:00
if (first1 === lib2.ENDED) {
2026-08-24 06:08:38 +00:00
callback2(tmp5.PLAYING);
2026-07-20 16:05:17 +00:00
}
}, items16));
2026-07-29 08:29:29 +00:00
ref2 = obj.useRef(0);
ref3 = obj.useRef(0);
const items17 = [sharedValue1, quest, ref2, ref3, questTaskDetails.taskType, tmp15, handleProgressAnalytics];
2026-07-20 16:05:17 +00:00
const items18 = [first, quest, handleEndAnalytics, onEnd];
2026-07-29 08:29:29 +00:00
const callback12 = obj.useCallback((seekableDuration) => {
2026-07-20 16:05:17 +00:00
let num = 0;
if (0 !== seekableDuration.seekableDuration) {
num = seekableDuration.currentTime / seekableDuration.seekableDuration;
}
closure_21.current = seekableDuration.currentTime;
if (seekableDuration.currentTime >= ref2.current) {
2026-07-29 08:29:29 +00:00
handleBufferAnalytics(ref[27]).sendVideoProgress(quest, seekableDuration.currentTime);
2026-07-20 16:05:17 +00:00
handleProgressAnalytics(num, seekableDuration.seekableDuration, seekableDuration.currentTime);
const _Math = Math;
const sum = seekableDuration.currentTime + 6;
2026-07-29 08:29:29 +00:00
tmp.current = sum + 2 * Math.random();
2026-08-24 06:08:38 +00:00
obj = handleBufferAnalytics(ref[27]);
2026-07-20 16:05:17 +00:00
}
if (seekableDuration.currentTime >= ref3.current) {
2026-07-29 08:29:29 +00:00
const result = handleBufferAnalytics(ref[28]).updateOptimisticProgress(quest.id, questTaskDetails.taskType, seekableDuration.currentTime);
tmp10.current = seekableDuration.currentTime + 1;
const obj2 = handleBufferAnalytics(ref[28]);
2026-07-20 16:05:17 +00:00
}
2026-08-24 06:08:38 +00:00
callback(quest.id, seekableDuration.currentTime, seekableDuration.seekableDuration);
2026-07-20 16:05:17 +00:00
const result1 = sharedValue1.set(num);
const current = ref1.current;
2026-07-29 08:29:29 +00:00
if (current != null) {
2026-07-20 16:05:17 +00:00
current.onProgress(seekableDuration.currentTime);
}
}, items17);
const items19 = [handleLoadStartAnalytics];
2026-07-29 08:29:29 +00:00
const callback13 = obj.useCallback(() => {
handleBufferAnalytics(ref[27]).sendVideoProgress(quest, first);
2026-07-20 16:05:17 +00:00
handleEndAnalytics();
2026-08-24 06:08:38 +00:00
callback2(lib2.ENDED);
2026-07-20 16:05:17 +00:00
const current = ref1.current;
2026-07-29 08:29:29 +00:00
if (current != null) {
2026-07-20 16:05:17 +00:00
current.onProgress(first);
}
const current2 = ref1.current;
2026-07-29 08:29:29 +00:00
if (current2 != null) {
2026-07-20 16:05:17 +00:00
current2.onEnd();
}
2026-07-29 08:29:29 +00:00
if (ref1 != null) {
ref1();
2026-07-20 16:05:17 +00:00
}
}, items18);
const items20 = [handleErrorAnalytics];
2026-07-29 08:29:29 +00:00
const callback14 = obj.useCallback(() => {
2026-08-24 06:08:38 +00:00
callback2(lib2.LOADING);
2026-07-20 16:05:17 +00:00
handleLoadStartAnalytics();
const current = ref1.current;
2026-07-29 08:29:29 +00:00
if (current != null) {
2026-07-20 16:05:17 +00:00
current.onLoadStart();
}
const current2 = ref1.current;
2026-07-29 08:29:29 +00:00
if (current2 != null) {
2026-07-20 16:05:17 +00:00
current2.onPlay();
}
}, items19);
2026-07-29 08:29:29 +00:00
const callback15 = obj.useCallback((arg0) => {
2026-08-24 06:08:38 +00:00
callback2(lib2.ERRORED);
2026-07-20 16:05:17 +00:00
handleErrorAnalytics(arg0);
const current = ref1.current;
2026-07-29 08:29:29 +00:00
if (current != null) {
2026-07-20 16:05:17 +00:00
current.onError(arg0);
}
}, items20);
2026-07-29 08:29:29 +00:00
const callback16 = obj.useCallback((videoTracks) => {
2026-07-20 16:05:17 +00:00
let tmp = null != videoTracks && null != videoTracks.videoTracks;
if (tmp) {
tmp = videoTracks.videoTracks.length > 0;
}
if (tmp) {
tmp = null != videoTracks.selectedVideoTrackId;
}
if (tmp) {
tmp = videoTracks.selectedVideoTrackId.length > 0;
}
if (tmp) {
const current = ref1.current;
2026-07-29 08:29:29 +00:00
if (current != null) {
2026-07-20 16:05:17 +00:00
current.onVideoTrackChange(videoTracks.selectedVideoTrackId, videoTracks.videoTracks);
}
}
}, []);
2026-07-29 08:29:29 +00:00
const callback17 = obj.useCallback((nativeEvent) => {
2026-07-20 16:05:17 +00:00
let layout;
2026-07-29 08:29:29 +00:00
if (nativeEvent != null) {
2026-07-20 16:05:17 +00:00
nativeEvent = nativeEvent.nativeEvent;
2026-07-29 08:29:29 +00:00
if (nativeEvent != null) {
2026-07-20 16:05:17 +00:00
layout = nativeEvent.layout;
}
}
if (null != layout) {
({ width, height } = nativeEvent.nativeEvent.layout);
2026-07-29 08:29:29 +00:00
if (tmp2) {
const current = ref1.current;
if (current != null) {
const result = current.updateVideoDimensions(width, height);
2026-07-20 16:05:17 +00:00
}
}
2026-07-29 08:29:29 +00:00
tmp2 = width > 0 && height > 0;
2026-07-20 16:05:17 +00:00
}
}, []);
2026-07-29 08:29:29 +00:00
const callbackResult1 = callback(callback11);
2026-08-24 06:08:38 +00:00
const items21 = [closure_8];
const tmp67 = handleBufferAnalytics(589).useStateFromStores(items21, () => state.getState()) === first.ACTIVE;
2026-07-20 16:05:17 +00:00
const items22 = [memo1, memo];
2026-07-29 08:29:29 +00:00
const memo2 = obj.useMemo(() => {
let tmp2 = null;
2026-07-20 16:05:17 +00:00
if (null != memo) {
let url;
2026-07-29 08:29:29 +00:00
if (memo1 != null) {
2026-07-20 16:05:17 +00:00
url = memo1.url;
}
2026-07-29 08:29:29 +00:00
if (url == null) {
url = tmp.url;
2026-07-20 16:05:17 +00:00
}
2026-08-24 06:08:38 +00:00
obj = { uri: null };
2026-07-29 08:29:29 +00:00
obj[0] = url;
tmp2 = obj;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
return tmp2;
2026-07-20 16:05:17 +00:00
}, items22);
2026-07-29 08:29:29 +00:00
const layoutEffect = obj.useLayoutEffect(() => {
2026-07-20 16:05:17 +00:00
if (obj.isAndroid()) {
2026-07-23 10:11:24 +00:00
const current = ref.current;
2026-07-20 16:05:17 +00:00
return () => {
2026-07-29 08:29:29 +00:00
try {
if (current != null) {
const setNativeProps = current.setNativeProps;
if (setNativeProps != null) {
2026-08-24 06:08:38 +00:00
obj = { paused: true, src: null };
2026-07-29 08:29:29 +00:00
obj[1] = { uri: null };
setNativeProps(obj);
}
}
} catch (tmp4) {
2026-08-24 06:08:38 +00:00
closure_1_1(closure_1_2[30]).captureException(tmp4);
const obj2 = closure_1_1(closure_1_2[30]);
2026-07-20 16:05:17 +00:00
}
};
}
2026-07-29 08:29:29 +00:00
obj = handleBufferAnalytics(ref[25]);
2026-07-20 16:05:17 +00:00
}, []);
2026-07-29 08:29:29 +00:00
let tmp70 = !tmp67;
if (tmp67) {
tmp70 = first1 === tmp17.PAUSED;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
if (!tmp70) {
tmp70 = first1 === tmp17.LOADING;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
if (!tmp70) {
tmp70 = externallyPaused;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
dependencyMap = obj.useRef(false);
tmp12Result = tmp12(obj.useState(false), 2);
[tmp72, orientation] = tmp12Result;
const items23 = [handleBufferAnalytics, ref1];
callback18 = obj.useCallback((current) => {
orientation(current);
if (current !== ref.current) {
ref.current = current;
handleBufferAnalytics(current);
current = ref1.current;
if (current != null) {
current.onBuffer(current);
}
}
}, items23);
const items24 = [callback18, first1];
const items25 = [callback18];
const callback19 = obj.useCallback((isBuffering) => {
2026-07-20 16:05:17 +00:00
isBuffering = isBuffering.isBuffering;
if (!isBuffering) {
if (!isBuffering) {
2026-07-29 08:29:29 +00:00
callback18(false);
2026-07-20 16:05:17 +00:00
}
} else {
2026-07-29 08:29:29 +00:00
if (first1 !== lib2.LOADING) {
2026-08-24 06:08:38 +00:00
obj = handleBufferAnalytics(ref[25]);
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
callback18(true);
2026-07-20 16:05:17 +00:00
}
}, items24);
2026-07-29 08:29:29 +00:00
const items26 = [callback18];
const callback20 = obj.useCallback(() => {
2026-07-20 16:05:17 +00:00
if (obj.isIOS()) {
2026-07-29 08:29:29 +00:00
callback18(true);
2026-07-20 16:05:17 +00:00
}
}, items25);
2026-07-29 08:29:29 +00:00
const callback21 = obj.useCallback(() => {
if (obj.isIOS()) {
callback18(false);
}
}, items26);
2026-08-15 05:55:55 +00:00
const rect = tmp29(1629)();
2026-07-20 16:05:17 +00:00
if (null == memo2) {
return null;
} else {
2026-07-29 08:29:29 +00:00
let tmp77 = isFullscreen;
2026-07-20 16:05:17 +00:00
if (isFullscreen) {
2026-07-29 08:29:29 +00:00
tmp77 = null != rect;
}
if (tmp77) {
obj2 = { paddingRight: null, paddingLeft: null };
let _Math = Math;
obj2[0] = Math.max(rect.right, obj.right);
let _Math2 = Math;
obj2[1] = Math.max(rect.left, obj.left);
tmp77 = obj2;
}
const obj3 = { style: null, accessible: false, children: null };
const items27 = [tmp.container, style];
obj3[0] = items27;
const obj4 = { style: null, onPress: null, accessible: null, accessibilityLabel: null, children: null };
const items28 = [tmp.videoContainer];
obj4[0] = items28;
obj4[1] = callback9;
obj4[2] = !first2;
const intl = tmp3(1236).intl;
const t = tmp3(1236).t;
obj4[3] = intl.string(tmp70 ? t.R3aFPe : t.fTMEUi);
let tmp80Result = first1 !== tmp17.ERRORED;
if (tmp80Result) {
const obj5 = { mixWithOthers: "inherit", ref: null, accessible: false, importantForAccessibility: "no-hide-descendants", accessibilityRole: "none", style: null, paused: null, source: null, onBuffer: null, onPlaybackStalled: null, onPlaybackResume: null, onLoad: null, onSeek: null, onProgress: null, onLoadStart: null, onEnd: null, onError: null, onReadyForDisplay: null, onVideoTracks: null, onLayout: null, resizeMode: "contain" };
obj5[1] = ref;
obj5[5] = tmp.video;
obj5[6] = tmp70;
obj5[7] = memo2;
obj5[8] = callback19;
obj5[9] = callback20;
obj5[10] = callback21;
obj5[11] = callback3;
obj5[12] = callback10;
obj5[13] = callback12;
obj5[14] = callback14;
obj5[15] = callback13;
obj5[16] = callback15;
obj5[17] = callback1;
obj5[18] = callback16;
obj5[19] = callback17;
tmp80Result = tmp80(first1, obj5);
}
const items29 = [tmp80Result, , , , , ];
const obj6 = { quest: null, currentTime: null, visible: null, style: null };
obj6[0] = quest;
obj6[1] = tmp16.timestampSec;
obj6[2] = flag;
let num3;
if (contentInsets != null) {
num3 = contentInsets.top;
}
if (num3 == null) {
num3 = 0;
}
const obj7 = { top: null, bottom: null, left: null, right: null };
obj7[0] = num3;
let num4;
if (contentInsets != null) {
num4 = contentInsets.bottom;
}
if (num4 == null) {
num4 = 0;
}
obj7[1] = num4;
let num5;
if (contentInsets != null) {
num5 = contentInsets.left;
}
if (num5 == null) {
num5 = 0;
}
obj7[2] = num5;
let num6;
if (contentInsets != null) {
num6 = contentInsets.right;
}
if (num6 == null) {
num6 = 0;
}
obj7[3] = num6;
obj6[3] = obj7;
2026-08-24 06:08:38 +00:00
items29[1] = targetSeconds(tmp3(14565).VideoQuestCaptions, obj6);
2026-07-29 08:29:29 +00:00
if (!tmp72) {
items29[2] = tmp72;
tmp80Result = !tmp39;
if (!tmp39) {
const obj8 = { style: null, children: null };
obj8[0] = tmp.loadingContainer;
obj8[1] = tmp80(questTaskDetails, { animating: true });
tmp80Result = tmp80(tmp81, obj8);
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
items29[3] = tmp80Result;
const obj9 = { style: null, accessible: false, children: null };
const items30 = [tmp.controls, animatedStyle];
obj9[0] = items30;
let tmp80Result4 = "landscape" === orientation;
let tmp82Result = tmp80Result4;
if (tmp80Result4) {
const obj10 = { style: null, children: null };
const items31 = [, , ];
({ controlsTopBottom: arr33[0], controlsTop: arr33[1] } = tmp);
items31[2] = tmp77;
obj10[0] = items31;
2026-07-20 16:05:17 +00:00
if (!hasCaptionAsset) {
2026-07-29 08:29:29 +00:00
const items32 = [hasCaptionAsset, ];
2026-07-20 16:05:17 +00:00
if (flag2) {
2026-07-29 08:29:29 +00:00
const obj11 = { accessibilityRole: "button", accessibilityLabel: null, onPress: null, style: null, children: null };
const intl3 = tmp3(1236).intl;
obj11[1] = intl3.string(tmp3(1236).t.KCzjTi);
obj11[2] = handleOpenTranscript;
obj11[3] = tmp.controlButton;
obj12 = { color: null };
obj12[0] = tmp.iconDisabled.color;
2026-08-24 06:08:38 +00:00
obj11[4] = tmp80(tmp3(14451).TranscriptOutlineIcon, obj12);
flag2 = tmp80(tmp3(5438).PressableOpacity, obj11);
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
items32[1] = flag2;
obj10[1] = items32;
tmp82Result = tmp82(tmp81, obj10);
2026-07-20 16:05:17 +00:00
} else {
2026-07-29 08:29:29 +00:00
const obj13 = { accessibilityRole: "button", accessibilityLabel: null, onPress: null, style: null, children: null };
const intl2 = tmp3(1236).intl;
obj13[1] = intl2.string(tmp3(1236).t.bDSZO1);
obj13[2] = handleToggleCaptions;
obj13[3] = tmp.controlButton;
2026-07-20 16:05:17 +00:00
if (flag) {
2026-07-29 08:29:29 +00:00
let color = tmp.icon.color;
2026-07-20 16:05:17 +00:00
} else {
2026-07-29 08:29:29 +00:00
color = tmp.iconDisabled.color;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
const obj14 = { color: null };
obj14[0] = color;
2026-08-24 06:08:38 +00:00
obj13[4] = tmp80(tmp3(14449).ClosedCaptionsOutlineIcon, obj14);
tmp80(tmp3(5438).PressableOpacity, obj13);
2026-07-20 16:05:17 +00:00
}
}
2026-07-29 08:29:29 +00:00
const items33 = [tmp82Result, , ];
const obj15 = { style: null, children: null };
obj15[0] = tmp.controlsMiddle;
const obj16 = { disabled: null, accessibilityRole: "button", accessibilityLabel: null, onPress: null, children: null };
obj16[0] = first1 === tmp17.ERRORED;
const intl4 = tmp3(1236).intl;
obj16[2] = intl4.string(tmp3(1236).t.r9s3Uv);
obj16[3] = callbackResult;
const obj17 = { color: null, width: 16, height: 16 };
obj17[0] = tmp.icon.color;
2026-08-24 06:08:38 +00:00
obj16[4] = tmp80(tmp3(14454).SkipBackwardIcon, obj17);
const items34 = [tmp80(tmp3(14453).VideoQuestPlayerControlButton, obj16), , ];
2026-07-29 08:29:29 +00:00
if (!tmp22) {
if (first1 !== tmp17.ERRORED) {
const t2 = tmp3(1236).t;
let K0e7M9 = tmp70 ? t2.R3aFPe : t2.fTMEUi;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
const obj18 = { accessibilityRole: "button", accessibilityLabel: null, onPress: null, children: null };
obj18[1] = tmp93(K0e7M9);
obj18[2] = callback5;
if (!tmp22) {
if (first1 !== tmp17.ERRORED) {
if (tmp70) {
2026-08-24 06:08:38 +00:00
let PauseIcon = tmp3(9040).PlayIcon;
2026-07-20 16:05:17 +00:00
} else {
2026-08-24 06:08:38 +00:00
PauseIcon = tmp3(9042).PauseIcon;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
let tmp80Result2 = tmp80(PauseIcon, { size: "lg" });
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
obj18[3] = tmp80Result2;
2026-08-24 06:08:38 +00:00
items34[1] = tmp80(tmp3(14453).VideoQuestPlayerControlButton, obj18);
2026-07-29 08:29:29 +00:00
const obj19 = { disabled: null, accessibilityRole: "button", accessibilityLabel: null, onPress: null, children: null };
obj19[0] = tmp51;
const intl5 = tmp3(1236).intl;
obj19[2] = intl5.string(tmp3(1236).t.zWDcNP);
obj19[3] = callbackResult1;
const obj20 = { color: null, width: 16, height: 16 };
obj20[0] = tmp.icon.color;
2026-08-24 06:08:38 +00:00
obj19[4] = tmp80(tmp3(14455).SkipForwardIcon, obj20);
items34[2] = tmp80(tmp3(14453).VideoQuestPlayerControlButton, obj19);
2026-07-29 08:29:29 +00:00
obj15[1] = items34;
items33[1] = tmp82(tmp81, obj15);
let tmp80Result3 = tmp80Result4;
if (tmp80Result4) {
const obj21 = { style: null, children: null };
const items35 = [, , ];
({ controlsTopBottom: arr37[0], controlsBottom: arr37[1] } = tmp);
items35[2] = tmp77;
obj21[0] = items35;
const obj22 = { accessibilityRole: "button", accessibilityLabel: null, onPress: null, style: null, children: null };
const intl6 = tmp3(1236).intl;
obj22[1] = intl6.string(tmp3(1236).t.vKZT5t);
obj22[2] = callback8;
obj22[3] = tmp.controlButton;
2026-08-24 06:08:38 +00:00
obj22[4] = tmp80(tmp3(14456).FullscreenEnterIcon, {});
obj21[1] = tmp80(tmp3(5438).PressableOpacity, obj22);
2026-07-29 08:29:29 +00:00
tmp80Result3 = tmp80(tmp81, obj21);
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
items33[2] = tmp80Result3;
obj9[2] = items33;
2026-08-24 06:08:38 +00:00
items29[4] = tmp82(tmp29(4119).View, obj9);
2026-07-29 08:29:29 +00:00
if (tmp80Result4) {
const obj23 = { style: null, children: null };
obj23[0] = tmp.progressContainer;
const obj24 = { style: null };
const items36 = [tmp.progress, animatedStyle1];
obj24[0] = items36;
2026-08-24 06:08:38 +00:00
obj23[1] = tmp80(tmp29(4119).View, obj24);
2026-07-29 08:29:29 +00:00
tmp80Result4 = tmp80(tmp81, obj23);
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
items29[5] = tmp80Result4;
obj4[4] = items29;
obj3[2] = tmp82(tmp83, obj4);
return tmp80(tmp81, obj3);
2026-07-20 16:05:17 +00:00
}
2026-08-24 06:08:38 +00:00
tmp80Result2 = tmp80(tmp3(10162).RetryIcon, { size: "lg" });
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
K0e7M9 = tmp3(1236).t.K0e7M9;
2026-07-20 16:05:17 +00:00
} else {
2026-07-29 08:29:29 +00:00
let items37 = [tmp.bufferingSpinner, ];
2026-07-20 16:05:17 +00:00
if (!isFullscreen) {
if ("landscape" !== orientation) {
2026-07-29 08:29:29 +00:00
let num7;
if (contentInsets != null) {
num7 = contentInsets.top;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
if (num7 == null) {
num7 = 0;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
let obj25 = { top: null, left: null };
obj25[0] = num7;
let num8;
if (contentInsets != null) {
num8 = contentInsets.left;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
if (num8 == null) {
num8 = 0;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
obj25[1] = num8;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
const obj26 = { animating: true, style: null, color: null };
items37[1] = obj25;
obj26[1] = items37;
items37 = tmp29(712).unsafe_rawColors.WHITE;
obj26[2] = items37;
tmp80(tmp86, obj26);
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
obj25 = tmp.bufferingSpinnerCentered;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
tmp83 = quest;
2026-07-20 16:05:17 +00:00
}
});
2026-08-24 06:08:38 +00:00
let result = require("set").fileFinishedImporting("modules/quests/native/VideoQuestModal/VideoQuestPlayer.tsx");
2026-07-20 16:05:17 +00:00
export const PlayerState = obj12;
export const VideoQuestPlayer = memoResult;