useLiveStreaming(params?) : Object
useLiveStreaming can also be used to set up optional callbacks for live streaming events.
When multiple live streams are running concurrently (see multi-instance live streaming), you can pass an instanceId to get per-instance state. Without instanceId, the hook returns aggregate state across all instances. For a list of all active instances, see useLiveStreamingInstances.
Parameters (optional)
string
A valid UUID. When provided, returns state for a specific live streaming instance and filters event callbacks to only fire for that instance. See multi-instance live streaming.
Function
Callback for the
live-streaming-error event.Function
Callback for the
live-streaming-started event.Function
Callback for the
live-streaming-stopped event.Function
Callback for the
live-streaming-updated event.Function
Callback for the
nonfatal-error event with type 'live-streaming-warning'.Return value
An object with the following properties:Without instanceId (aggregate state)
When called without instanceId, the hook returns aggregate state across all live streaming instances. This works well for single-instance use cases — the scalar fields (errorMsg, layout) reflect the only active instance. With multiple concurrent instances, these fields reflect the first active instance; use useLiveStreaming({ instanceId }) for unambiguous per-instance access.
string
Error message from the first errored instance. With multiple instances, use
useLiveStreaming({ instanceId }) for per-instance error state.boolean
true if any live streaming instance is active.Object
Layout of the first active instance. With multiple instances, use
useLiveStreaming({ instanceId }) for per-instance layout.Function
Wraps
startLiveStreaming().Function
Wraps
stopLiveStreaming().Function
Wraps
updateLiveStreaming().With instanceId (per-instance state)
When called with instanceId, the hook returns state for that specific live streaming instance only.
string
Error message for this instance, if any.
string
The instance ID.
boolean
Whether this instance is currently live streaming.
Object
The live streaming layout for this instance.
Function
Wraps
startLiveStreaming().Function
Wraps
stopLiveStreaming().Function
Wraps
updateLiveStreaming().