import * as Broadcast from "@livepeer/react/broadcast";
import { getIngest } from "@livepeer/react";
// Usage with a stream key
const streamKey = "your-stream-key-here";
const whipUrl = getIngest(streamKey, {
baseUrl: "https://playback.livepeer.studio/webrtc",
});
// Usage with Livepeer stream data
const livepeerStreamData = {
id: "stream-id",
streamKey: "your-stream-key-here",
// Other unused Livepeer stream data...
};
// This is either a string or null, depending on whether
// the input was parsed successfully
const whipUrlFromLivepeer = getIngest(livepeerStreamData);
export default () => (
<Broadcast.Root ingest={whipUrlFromLivepeer}>
{/* All child components. */}
</Broadcast.Root>
);