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

39 lines
1.2 KiB
TypeScript
Raw Normal View History

// Module ID: 17182
// Function ID: 17183
2026-07-20 16:05:17 +00:00
// Name: useExternalPipAspectRatioUpdater
// Dependencies: [19, 9680, 2]
2026-07-20 16:05:17 +00:00
// Exports: default
// Module 17182 (useExternalPipAspectRatioUpdater)
import ExternalPipDefault from "ExternalPip" /* 9680 */;
import noop from "module_19" /* 19 */;
2026-07-23 10:11:24 +00:00
let size = fn(2);
const result = size.fileFinishedImporting("modules/external_pip/useExternalPipAspectRatioUpdater.native.tsx");
2026-07-20 16:05:17 +00:00
export default function useExternalPipAspectRatioUpdater(arg0, arg1, set) {
2026-08-24 06:08:38 +00:00
closure_0 = arg1;
const current = set;
noop = noop.useRef(set);
const insertionEffect = noop.useInsertionEffect(() => {
closure_2.current = current;
2026-07-20 16:05:17 +00:00
});
const items = [arg1];
const effect = noop.useEffect(() => {
size = size.getTargetDimensions(ref.current);
size(current[1]).setPipAspectRatio(size.width, size.height);
return size.subscribeFromItem(() => {
const targetDimensions = size.getTargetDimensions(ref.current);
2026-07-20 16:05:17 +00:00
({ width, height } = targetDimensions);
let tmp2 = width === size.width;
2026-07-20 16:05:17 +00:00
if (tmp2) {
tmp2 = height === size.height;
2026-07-20 16:05:17 +00:00
}
if (!tmp2) {
size = { width, height };
ExternalPipDefault.setPipAspectRatio(width, height);
2026-07-20 16:05:17 +00:00
}
});
}, items);
};