Object containing streaming state (isStreaming, isStreamingStarting,
streamingId, featuredUserId, streamingStartTime, streamingDuration,
streamingUrl, error) and actions (startStreaming, stopStreaming,
clearStreamingError)
import { useStreaming } from '@hiyve/rn-react';
function StreamingControls() {
const { isStreaming, streamingDuration, streamingUrl, startStreaming, stopStreaming } = useStreaming();
return (
<View>
{isStreaming && <Text>Live: {streamingDuration}s</Text>}
{streamingUrl && <Text>Stream URL: {streamingUrl}</Text>}
<Button
title={isStreaming ? 'Stop Streaming' : 'Go Live'}
onPress={() => isStreaming ? stopStreaming() : startStreaming({ url: 'rtmp://...' })}
/>
</View>
);
}
Access live streaming state and controls.
Provides the current streaming status, a live duration counter that updates every second while streaming is active, and actions to start and stop streaming to external platforms (e.g., YouTube, Twitch).