UNPKG

@huddle01/react

Version:

The Huddle01 React SDK offers a comprehensive suite of hooks, methods and event listeners that allow for seamless real-time audio and video communication with minimal coding required.

32 lines (30 loc) 616 B
import { useRemoteMedia } from "./chunk-DXZV35JM.js"; // src/hooks/useRemoteAudio.ts var useRemoteAudio = (props) => { const { state, track, stream } = useRemoteMedia({ label: "audio", peerId: props.peerId, onClose: props.onClose, onPlayable: (data) => { props.onPlayable?.({ label: "audio", track: data.track, stream: data.stream }); }, onPaused: props?.onPaused }); const isAudioOn = state === "playable"; return { state, isAudioOn, track, stream }; }; export { useRemoteAudio }; //# sourceMappingURL=chunk-EGZYBLI2.js.map