Files

18 lines
784 B
JavaScript

import { jsx as _jsx } from "react/jsx-runtime";
import { useImperativeHandle, useState } from 'react';
import { flushSync } from 'react-dom';
import { Internals } from 'remotion';
export const UpdateTime = ({ children, audioEnabled, videoEnabled, logLevel, compId, initialFrame, timeUpdater, }) => {
const [frame, setFrame] = useState(initialFrame);
useImperativeHandle(timeUpdater, () => ({
update: (f) => {
flushSync(() => {
setFrame(f);
});
},
}));
return (_jsx(Internals.RemotionRootContexts, { audioEnabled: audioEnabled, videoEnabled: videoEnabled, logLevel: logLevel, numberOfAudioTags: 0, audioLatencyHint: "interactive", frameState: {
[compId]: frame,
}, children: children }));
};