Skip to main content
Version: 0.21.0

Class: FishjamAgent

Defined in: packages/js-server-sdk/packages/js-server-sdk/src/agent.ts:41

Extends

Constructors

Constructor

new FishjamAgent(config, agentToken, onError, onClose): FishjamAgent

Defined in: packages/js-server-sdk/packages/js-server-sdk/src/agent.ts:44

Parameters

ParameterType
configFishjamConfig
agentTokenstring
onErrorErrorEventHandler
onCloseCloseEventHandler

Returns

FishjamAgent

Overrides

(EventEmitter as new () => TypedEmitter<AgentEvents>).constructor

Methods

addListener()

addListener<E>(event, listener): this

Defined in: packages/js-server-sdk/node_modules/typed-emitter/index.d.ts:22

Type Parameters

Type Parameter
E extends "trackData"

Parameters

ParameterType
eventE
listenerAgentEvents[E]

Returns

this

Inherited from

(EventEmitter as new () => TypedEmitter<AgentEvents>).addListener


createTrack()

createTrack(codecParameters, metadata): Track

Defined in: packages/js-server-sdk/packages/js-server-sdk/src/agent.ts:62

Creates an outgoing audio track for the agent

Parameters

ParameterType
codecParametersAudioCodecParameters
metadataobject

Returns

Track

a new audio track


deleteTrack()

deleteTrack(trackId): void

Defined in: packages/js-server-sdk/packages/js-server-sdk/src/agent.ts:80

Deletes an outgoing audio track for the agent

Parameters

ParameterType
trackIdTrackId

Returns

void


emit()

emit<E>(event, ...args): boolean

Defined in: packages/js-server-sdk/node_modules/typed-emitter/index.d.ts:32

Type Parameters

Type Parameter
E extends "trackData"

Parameters

ParameterType
eventE
...argsParameters<AgentEvents[E]>

Returns

boolean

Inherited from

(EventEmitter as new () => TypedEmitter<AgentEvents>).emit


eventNames()

eventNames(): (string | symbol)[]

Defined in: packages/js-server-sdk/node_modules/typed-emitter/index.d.ts:34

Returns

(string | symbol)[]

Inherited from

(EventEmitter as new () => TypedEmitter<AgentEvents>).eventNames


getMaxListeners()

getMaxListeners(): number

Defined in: packages/js-server-sdk/node_modules/typed-emitter/index.d.ts:39

Returns

number

Inherited from

(EventEmitter as new () => TypedEmitter<AgentEvents>).getMaxListeners


listenerCount()

listenerCount<E>(event): number

Defined in: packages/js-server-sdk/node_modules/typed-emitter/index.d.ts:37

Type Parameters

Type Parameter
E extends "trackData"

Parameters

ParameterType
eventE

Returns

number

Inherited from

(EventEmitter as new () => TypedEmitter<AgentEvents>).listenerCount


listeners()

listeners<E>(event): AgentEvents[E][]

Defined in: packages/js-server-sdk/node_modules/typed-emitter/index.d.ts:36

Type Parameters

Type Parameter
E extends "trackData"

Parameters

ParameterType
eventE

Returns

AgentEvents[E][]

Inherited from

(EventEmitter as new () => TypedEmitter<AgentEvents>).listeners


off()

off<E>(event, listener): this

Defined in: packages/js-server-sdk/node_modules/typed-emitter/index.d.ts:28

Type Parameters

Type Parameter
E extends "trackData"

Parameters

ParameterType
eventE
listenerAgentEvents[E]

Returns

this

Inherited from

(EventEmitter as new () => TypedEmitter<AgentEvents>).off


on()

on<E>(event, listener): this

Defined in: packages/js-server-sdk/node_modules/typed-emitter/index.d.ts:23

Type Parameters

Type Parameter
E extends "trackData"

Parameters

ParameterType
eventE
listenerAgentEvents[E]

Returns

this

Inherited from

(EventEmitter as new () => TypedEmitter<AgentEvents>).on


once()

once<E>(event, listener): this

Defined in: packages/js-server-sdk/node_modules/typed-emitter/index.d.ts:24

Type Parameters

Type Parameter
E extends "trackData"

Parameters

ParameterType
eventE
listenerAgentEvents[E]

Returns

this

Inherited from

(EventEmitter as new () => TypedEmitter<AgentEvents>).once


prependListener()

prependListener<E>(event, listener): this

Defined in: packages/js-server-sdk/node_modules/typed-emitter/index.d.ts:25

Type Parameters

Type Parameter
E extends "trackData"

Parameters

ParameterType
eventE
listenerAgentEvents[E]

Returns

this

Inherited from

(EventEmitter as new () => TypedEmitter<AgentEvents>).prependListener


prependOnceListener()

prependOnceListener<E>(event, listener): this

Defined in: packages/js-server-sdk/node_modules/typed-emitter/index.d.ts:26

Type Parameters

Type Parameter
E extends "trackData"

Parameters

ParameterType
eventE
listenerAgentEvents[E]

Returns

this

Inherited from

(EventEmitter as new () => TypedEmitter<AgentEvents>).prependOnceListener


rawListeners()

rawListeners<E>(event): AgentEvents[E][]

Defined in: packages/js-server-sdk/node_modules/typed-emitter/index.d.ts:35

Type Parameters

Type Parameter
E extends "trackData"

Parameters

ParameterType
eventE

Returns

AgentEvents[E][]

Inherited from

(EventEmitter as new () => TypedEmitter<AgentEvents>).rawListeners


removeAllListeners()

removeAllListeners<E>(event?): this

Defined in: packages/js-server-sdk/node_modules/typed-emitter/index.d.ts:29

Type Parameters

Type Parameter
E extends "trackData"

Parameters

ParameterType
event?E

Returns

this

Inherited from

(EventEmitter as new () => TypedEmitter<AgentEvents>).removeAllListeners


removeListener()

removeListener<E>(event, listener): this

Defined in: packages/js-server-sdk/node_modules/typed-emitter/index.d.ts:30

Type Parameters

Type Parameter
E extends "trackData"

Parameters

ParameterType
eventE
listenerAgentEvents[E]

Returns

this

Inherited from

(EventEmitter as new () => TypedEmitter<AgentEvents>).removeListener


sendData()

sendData(trackId, data): void

Defined in: packages/js-server-sdk/packages/js-server-sdk/src/agent.ts:89

Send audio data for the given track

Parameters

ParameterType
trackIdTrackId
dataUint8Array

Returns

void


setMaxListeners()

setMaxListeners(maxListeners): this

Defined in: packages/js-server-sdk/node_modules/typed-emitter/index.d.ts:40

Parameters

ParameterType
maxListenersnumber

Returns

this

Inherited from

(EventEmitter as new () => TypedEmitter<AgentEvents>).setMaxListeners