Class: ConferenceClient

.Conference. ConferenceClient

The ConferenceClient handles PeerConnections between client and server. For conference controlling, please refer to REST API guide.
Events:

Event Name Argument Type Fired when
streamadded Owt.Base.StreamEvent A new stream is available in the conference.
participantjoined Owt.Conference.ParticipantEvent A new participant joined the conference.
messagereceived Owt.Base.MessageEvent A new message is received.
serverdisconnected Owt.Base.OwtEvent Disconnected from conference server.

new ConferenceClient(config, signalingImpl)

Parameters:
Name Type Argument Description
config Owt.Conference.ConferenceClientConfiguration <nullable>

Configuration for ConferenceClient.

signalingImpl Owt.Conference.SioSignaling <nullable>

Signaling channel implementation for ConferenceClient. SDK uses default signaling channel implementation if this parameter is undefined. Currently, a Socket.IO signaling channel implementation was provided as ics.conference.SioSignaling. However, it is not recommended to directly access signaling channel or customize signaling channel for ConferenceClient as this time.

Extends

Methods


addEventListener(eventType, listener)

This function registers a callback function as a handler for the corresponding event. It's shortened form is on(eventType, listener). See the event description in the following table.

Parameters:
Name Type Description
eventType string

Event string.

listener function

Callback function.

Inherited From:

clearEventListener(eventType)

This function removes all event listeners for one type.

Parameters:
Name Type Description
eventType string

Event string.

Inherited From:

join(tokenString)

Join a conference.

Parameters:
Name Type Description
tokenString string

Token is issued by conference server(nuve).

Returns:

Return a promise resolved with current conference's information if successfully join the conference. Or return a promise rejected with a newly created Owt.Error if failed to join the conference.

Type
Promise.<ConferenceInfo, Error>

leave()

Leave a conference.

Returns:

Returned promise will be resolved with undefined once the connection is disconnected.

Type
Promise.<void, Error>

publish(stream, options, videoCodecs)

Publish a LocalStream to conference server. Other participants will be able to subscribe this stream when it is successfully published.

Parameters:
Name Type Description
stream Owt.Base.LocalStream

The stream to be published.

options Owt.Base.PublishOptions

Options for publication.

videoCodecs Array.<string>

Video codec names for publishing. Valid values are 'VP8', 'VP9' and 'H264'. This parameter only valid when options.video is RTCRtpEncodingParameters. Publishing with RTCRtpEncodingParameters is an experimental feature. This parameter is subject to change.

Returns:

Returned promise will be resolved with a newly created Publication once specific stream is successfully published, or rejected with a newly created Error if stream is invalid or options cannot be satisfied. Successfully published means PeerConnection is established and server is able to process media data.

Type
Promise.<Publication, Error>

removeEventListener(eventType, listener)

This function removes a registered event listener.

Parameters:
Name Type Description
eventType string

Event string.

listener function

Callback function.

Inherited From:

send(message, participantId)

Send a text message to a participant or all participants.

Parameters:
Name Type Description
message string

Message to be sent.

participantId string

Receiver of this message. Message will be sent to all participants if participantId is undefined.

Returns:

Returned promise will be resolved when conference server received certain message.

Type
Promise.<void, Error>

subscribe(stream, options)

Subscribe a RemoteStream from conference server.

Parameters:
Name Type Description
stream Owt.Base.RemoteStream

The stream to be subscribed.

options Owt.Conference.SubscribeOptions

Options for subscription.

Returns:

Returned promise will be resolved with a newly created Subscription once specific stream is successfully subscribed, or rejected with a newly created Error if stream is invalid or options cannot be satisfied. Successfully subscribed means PeerConnection is established and server was started to send media data.

Type
Promise.<Subscription, Error>