useLiveStreaming

useLiveStreaming(params?) : Object

Returns information about a live stream, along with helper functions that wrap daily-js live streaming-related methods.

useLiveStreaming can also be used to set up optional callbacks for live streaming events.

Params (optional)

ParameterRequiredTypeDescription
onLiveStreamingErrorFunctionCallback for the live-streaming-error event
onLiveStreamingStartedFunctionCallback for the live-streaming-started event
onLiveStreamingStoppedFunctionCallback for the live-streaming-stopped event
onLiveStreamingUpdatedFunctionCallback for the live-streaming-updated event
onLiveStreamingWarningFunctionCallback for the nonfatal-error event with type 'live-streaming-warning'

Return type

An object with the following properties:

NameTypeDescription
errorMsgstringDetails a live streaming error, defaults to undefined
isLiveStreamingbooleanIndicates whether a live stream is currently happening, defaults to false
layoutObjectDescribes any preset live streaming layout, and any corresponding layout-specific details. Defaults to undefined
startLiveStreamingFunctionSee startLiveStreaming()
stopLiveStreamingFunctionSee stopLiveStreaming()
updateLiveStreamingFunctionSee updateLiveStreaming()

For more on live streaming with Daily, reference our guide.

Sample code