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)
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.
Callback for the
live-streaming-error event.Callback for the
live-streaming-started event.Callback for the
live-streaming-stopped event.Callback for the
live-streaming-updated event.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.
Error message from the first errored instance. With multiple instances, use
useLiveStreaming({ instanceId }) for per-instance error state.true if any live streaming instance is active.Layout of the first active instance. With multiple instances, use
useLiveStreaming({ instanceId }) for per-instance layout.Wraps
startLiveStreaming().Wraps
stopLiveStreaming().Wraps
updateLiveStreaming().With instanceId (per-instance state)
When called with instanceId, the hook returns state for that specific live streaming instance only.
Error message for this instance, if any.
The instance ID.
Whether this instance is currently live streaming.
The live streaming layout for this instance.
Wraps
startLiveStreaming().Wraps
stopLiveStreaming().Wraps
updateLiveStreaming().