Class: Subscription

.Conference. Subscription

Subscription is a receiver for receiving a stream.
Events:

Event Name Argument Type Fired when
ended Event Subscription is ended.
error ErrorEvent An error occurred on the subscription.
mute MuteEvent Publication is muted. Remote side stopped sending audio and/or video data.
unmute MuteEvent Publication is unmuted. Remote side continued sending audio and/or video data.

new Subscription()

Extends

Members


id :string

Type:
  • string

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:

applyOptions(options)

Update subscription with given options.

Parameters:
Name Type Description
options Owt.Conference.SubscriptionUpdateOptions

Subscription update options.

Returns:
Type
Promise.<undefined, Error>

clearEventListener(eventType)

This function removes all event listeners for one type.

Parameters:
Name Type Description
eventType string

Event string.

Inherited From:

getStats()

Get stats of underlying PeerConnection.

Returns:
Type
Promise.<RTCStatsReport, Error>

mute(kind)

Stop reeving data from remote endpoint.

Parameters:
Name Type Description
kind Owt.Base.TrackKind

Kind of tracks to be muted.

Returns:
Type
Promise.<undefined, 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:

stop()

Stop certain subscription. Once a subscription is stopped, it cannot be recovered.

Returns:
Type
undefined

unmute(kind)

Continue reeving data from remote endpoint.

Parameters:
Name Type Description
kind Owt.Base.TrackKind

Kind of tracks to be unmuted.

Returns:
Type
Promise.<undefined, Error>