koval-ui
Version:
React components collection with minimalistic design. Supports theming, layout, and input validation.
23 lines (22 loc) • 528 B
JavaScript
"use client";
import { useCallback as e, useState as i } from "react";
const h = ({ embedRef: a, setDuration: n, onReady: r, onError: o }) => {
const l = e(() => {
a.current?.duration && n(a.current?.duration);
}, [n, a]), [s, c] = i(!1), u = e(
(t) => {
c(!0), r(t);
},
[r]
), d = e(
(t) => {
o(t);
},
[o]
);
return { handleLoadedMetaData: l, readyToPlay: s, handleCanPlay: u, handleError: d };
};
export {
h as useLoadingState
};
//# sourceMappingURL=useLoadingState.js.map