decord/source/modules/external_pip/useExternalPipAspectRatioUpdater.native.tsx

40 lines
1.2 KiB
TypeScript
Raw Normal View History

2026-07-24 07:16:23 +00:00
// Module ID: 15818
// Function ID: 122039
2026-07-20 16:05:17 +00:00
// Name: useExternalPipAspectRatioUpdater
2026-07-24 07:16:23 +00:00
// Dependencies: [31, 10263, 2]
2026-07-20 16:05:17 +00:00
// Exports: default
2026-07-24 07:16:23 +00:00
// Module 15818 (useExternalPipAspectRatioUpdater)
2026-07-23 10:11:24 +00:00
import result from "result";
const result = require("set").fileFinishedImporting("modules/external_pip/useExternalPipAspectRatioUpdater.native.tsx");
2026-07-20 16:05:17 +00:00
export default function useExternalPipAspectRatioUpdater(arg0, arg1, arg2) {
2026-07-23 10:11:24 +00:00
let closure_0 = arg1;
let closure_1 = arg2;
React = React.useRef(arg2);
2026-07-20 16:05:17 +00:00
const insertionEffect = React.useInsertionEffect(() => {
2026-07-23 10:11:24 +00:00
result.current = closure_1;
2026-07-20 16:05:17 +00:00
});
const items = [arg1];
2026-07-23 10:11:24 +00:00
const effect = React.useEffect(() => {
size = size.getTargetDimensions(ref.current);
callback(table[1]).setPipAspectRatio(size.width, size.height);
return size.subscribeFromItem(() => {
2026-07-20 16:05:17 +00:00
let height;
let width;
2026-07-23 10:11:24 +00:00
const targetDimensions = size.getTargetDimensions(outer1_2.current);
2026-07-20 16:05:17 +00:00
({ width, height } = targetDimensions);
2026-07-23 10:11:24 +00:00
let tmp2 = width === obj.width;
2026-07-20 16:05:17 +00:00
if (tmp2) {
2026-07-23 10:11:24 +00:00
tmp2 = height === obj.height;
2026-07-20 16:05:17 +00:00
}
if (!tmp2) {
2026-07-23 10:11:24 +00:00
obj = { width, height };
size(table[1]).setPipAspectRatio(width, height);
const obj2 = size(table[1]);
2026-07-20 16:05:17 +00:00
}
});
}, items);
};