Skip to main content

Function: useCustomSource()

useCustomSource<T>(sourceId): object

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

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

Type Parameters

Type Parameter
T extends string

Parameters

ParameterType
sourceIdT

Returns

object

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