Skip to main content
Version: 0.29.0

Function: useCustomSource()

useCustomSource<T>(sourceId): object

Defined in: react-client/src/hooks/useCustomSource.ts:11

This hook can register/deregister a custom MediaStream with Fishjam.

Type Parameters​

Type Parameter
T extends string

Parameters​

ParameterTypeDescription
sourceIdTStable id identifying this custom source.

Returns​

setStream()​

setStream: (newStream) => Promise<void>

Associates the given stream with the custom source. This stream will be sent to Fishjam after startStreaming has been called.

Parameters​

ParameterType
newStreamnull | MediaStream

Returns​

Promise<void>

stream​

stream: undefined | MediaStream

The MediaStream currently associated with the custom source