Options
All
  • Public
  • Public/Protected
  • All
Menu

Class WebRtcConnectionBase<TConnection, TStream, TAudioStream, TVideoStream, TDataStream, TDataChannel>

Connection base properties/methods.

Type parameters

  • TConnection: WebRtcConnectionBase<TConnection, TStream, TAudioStream, TVideoStream, TDataStream, TDataChannel>

  • TStream: WebRtcStreamBase

  • TAudioStream: IAudioStream

  • TVideoStream: IVideoStream

  • TDataStream: IDataStream<TDataChannel>

  • TDataChannel: IDataChannel<TDataChannel>

Hierarchy

  • Dynamic
    • WebRtcConnectionBase

Implements

  • IConnection<TConnection, TStream, TAudioStream, TVideoStream, TDataStream>

Index

Constructors

Properties

Methods

Constructors

constructor

  • Initializes a new instance of the fm.icelink.connectionBase class.

    Parameters

    • sharedLock: Object

    Returns WebRtcConnectionBase

Properties

Private __iceServers

__iceServers: IceServerCollection
internal

Private __onGatheringStateChange

__onGatheringStateChange: Array<IAction1<TConnection>>
internal

Private __onIceConnectionStateChange

__onIceConnectionStateChange: Array<IAction1<TConnection>>
internal

Private __onLocalCandidate

__onLocalCandidate: Array<IAction2<TConnection, Candidate>>
internal

Private __onLocalDescription

__onLocalDescription: Array<IAction2<TConnection, SessionDescription>>
internal

Private __onRemoteCandidate

__onRemoteCandidate: Array<IAction2<TConnection, Candidate>>
internal

Private __onRemoteDescription

__onRemoteDescription: Array<IAction2<TConnection, SessionDescription>>
internal

Private __onSignallingStateChange

__onSignallingStateChange: Array<IAction1<TConnection>>
internal

Private __onStateChange

__onStateChange: Array<IAction1<TConnection>>
internal

Private __signallingState

__signallingState: SignallingState
internal

Private __state

__state: ConnectionState
internal

Private __stateTimestamp

__stateTimestamp: DateTime
internal

Private __trickleIcePolicy

__trickleIcePolicy: TrickleIcePolicy
internal

Private __useTrickleIce

__useTrickleIce: boolean
internal

_connectionLock

_connectionLock: Object
The state lock.
field

_connectionLock

type

{Object}

internal

Private _deadStreamTimeout

_deadStreamTimeout: number
internal

Private _earlyRemoteCandidatePromises

_earlyRemoteCandidatePromises: Array<RemoteCandidatePromise>
internal

Private _error

_error: Error
internal

Private _iceGatherPolicy

_iceGatherPolicy: IceGatherPolicy
internal

Private _id

_id: string
internal

Private _internalId

_internalId: string
internal

Private _onGatheringStateChange

_onGatheringStateChange: IAction1<TConnection>
internal

Private _onIceConnectionStateChange

_onIceConnectionStateChange: IAction1<TConnection>
internal

Private _onLocalCandidate

_onLocalCandidate: IAction2<TConnection, Candidate>
internal

Private _onLocalDescription

_onLocalDescription: IAction2<TConnection, SessionDescription>
internal

Private _onRemoteCandidate

_onRemoteCandidate: IAction2<TConnection, Candidate>
internal

Private _onRemoteDescription

_onRemoteDescription: IAction2<TConnection, SessionDescription>
internal

Private _onSignallingStateChange

_onSignallingStateChange: IAction1<TConnection>
internal

Private _onStateChange

_onStateChange: IAction1<TConnection>
internal

Private _tieBreaker

_tieBreaker: string
internal

Private _timeout

_timeout: number
internal

Methods

addIceServer

  • addIceServer(iceServer: IceServer): void
  • Adds an ICE server.

    Parameters

    • iceServer: IceServer

      The ICE server.

    Returns void

addIceServers

  • addIceServers(iceServers: IceServer[]): void
  • Adds some ICE servers.

    Parameters

    • iceServers: IceServer[]

      The ICE servers.

    Returns void

addOnGatheringStateChange

  • addOnGatheringStateChange(value: IAction1<TConnection>): void
  • Adds a handler that is raised when the gathering state changes.

    Parameters

    • value: IAction1<TConnection>

    Returns void

addOnIceConnectionStateChange

  • addOnIceConnectionStateChange(value: IAction1<TConnection>): void
  • Adds a handler that is raised when the ice connection state changes.

    Parameters

    • value: IAction1<TConnection>

    Returns void

addOnLocalCandidate

  • addOnLocalCandidate(value: IAction2<TConnection, Candidate>): void
  • Adds a handler that is raised when a local candidate is added.

    Parameters

    • value: IAction2<TConnection, Candidate>

    Returns void

addOnLocalDescription

  • addOnLocalDescription(value: IAction2<TConnection, SessionDescription>): void
  • Adds a handler that is raised when a local description is set.

    Parameters

    • value: IAction2<TConnection, SessionDescription>

    Returns void

addOnRemoteCandidate

  • addOnRemoteCandidate(value: IAction2<TConnection, Candidate>): void
  • Adds a handler that is raised when a remote description is added.

    Parameters

    • value: IAction2<TConnection, Candidate>

    Returns void

addOnRemoteDescription

  • addOnRemoteDescription(value: IAction2<TConnection, SessionDescription>): void
  • Adds a handler that is raised when a remote description is set.

    Parameters

    • value: IAction2<TConnection, SessionDescription>

    Returns void

addOnSignallingStateChange

  • addOnSignallingStateChange(value: IAction1<TConnection>): void
  • Adds a handler that is raised when the signalling state changes.

    Parameters

    • value: IAction1<TConnection>

    Returns void

addOnStateChange

  • addOnStateChange(value: IAction1<TConnection>): void
  • Adds a handler that is raised when the connection state changes.

    Parameters

    • value: IAction1<TConnection>

    Returns void

addRemoteCandidate

  • addRemoteCandidate(remoteCandidate: Candidate): Future<Candidate>
  • Adds the remote candidate.

    Parameters

    • remoteCandidate: Candidate

      The remote candidate.

    Returns Future<Candidate>

Private addRemoteCandidatePromise

  • internal

    Parameters

    Returns void

Abstract close

  • close(): void
  • Closes this instance.

    Returns void

createAnswer

  • createAnswer(): Future<SessionDescription>
  • Creates an answer.

    Returns Future<SessionDescription>

createOffer

  • createOffer(): Future<SessionDescription>
  • Creates an offer.

    Returns Future<SessionDescription>

Protected Abstract doAddRemoteCandidate

  • doAddRemoteCandidate(promise: Promise<Candidate>, remoteCandidate: Candidate): void
  • Adds the remote candidate.

    Parameters

    • promise: Promise<Candidate>

      The promise.

    • remoteCandidate: Candidate

      The remote candidate.

    Returns void

Protected Abstract doCreateAnswer

  • doCreateAnswer(promise: Promise<SessionDescription>): void
  • Creates an answer.

    Parameters

    • promise: Promise<SessionDescription>

    Returns void

Protected Abstract doCreateOffer

  • doCreateOffer(promise: Promise<SessionDescription>): boolean
  • Creates an offer.

    Parameters

    • promise: Promise<SessionDescription>

    Returns boolean

Protected Abstract doSendCachedLocalCandidates

  • doSendCachedLocalCandidates(): void
  • Dispatches cached local candidates that were gathered while Connection generated session description.

    Returns void

Protected Abstract doSetLocalDescription

  • doSetLocalDescription(promise: Promise<SessionDescription>, localDescription: SessionDescription): void
  • Sets the local description.

    Parameters

    • promise: Promise<SessionDescription>

      The promise.

    • localDescription: SessionDescription

      The local description.

    Returns void

Protected Abstract doSetRemoteDescription

  • doSetRemoteDescription(promise: Promise<SessionDescription>, remoteDescription: SessionDescription): void
  • Sets the remote description.

    Parameters

    • promise: Promise<SessionDescription>

      The promise.

    • remoteDescription: SessionDescription

      The remote description.

    Returns void

Private fmicelinkWebRtcConnectionBaseInit

  • fmicelinkWebRtcConnectionBaseInit(): void
  • Returns void

getAudioStream

  • getAudioStream(): TAudioStream
  • Gets the first audio stream.

    Returns TAudioStream

Abstract getAudioStreams

  • getAudioStreams(): TAudioStream[]
  • Gets the audio streams.

    Returns TAudioStream[]

getDataStream

  • getDataStream(): TDataStream
  • Gets the first data stream.

    Returns TDataStream

Abstract getDataStreams

  • getDataStreams(): TDataStream[]
  • Gets the data streams.

    Returns TDataStream[]

getDeadStreamTimeout

  • getDeadStreamTimeout(): number
  • Gets the amount of time (in milliseconds) to wait for connectivity checks to re-establish after they start to fail on a live connection. Defaults to 15,000.

    Returns number

getDynamicProperties

  • getDynamicProperties(): Hash<string, Object>
  • Gets the dynamic properties on this instance.

    Returns Hash<string, Object>

getDynamicValue

  • getDynamicValue(key: string): Object
  • Gets a property value from the local cache.

    Parameters

    • key: string

      The property key. This key is used internally only, but should be namespaced to avoid conflict with third-party extensions.

    Returns Object

    The stored value, if found; otherwise null.

getError

  • getError(): Error
  • Gets the error.

    Returns Error

Abstract getGatheringState

  • getGatheringState(): IceGatheringState
  • Gets the ICE gathering state.

    Returns IceGatheringState

getHasAudio

  • getHasAudio(): boolean
  • Gets whether this connection has an audio stream.

    Returns boolean

getHasData

  • getHasData(): boolean
  • Gets whether this connection has a data stream.

    Returns boolean

getHasVideo

  • getHasVideo(): boolean
  • Gets whether this connection has a video stream.

    Returns boolean

Abstract getIceConnectionState

  • getIceConnectionState(): IceConnectionState
  • Gets the ICE connection state.

    Returns IceConnectionState

getIceGatherPolicy

  • getIceGatherPolicy(): IceGatherPolicy
  • Gets the ICE gather policy.

    Returns IceGatherPolicy

getIceServer

  • getIceServer(): IceServer
  • Gets the ICE server.

    Returns IceServer

getIceServers

  • getIceServers(): IceServer[]
  • Gets the ICE servers.

    Returns IceServer[]

getId

  • getId(): string
  • Gets the identifier.

    Returns string

Protected Abstract getInstance

  • getInstance(): TConnection
  • Gets the current instance.

    Returns TConnection

getInternalId

  • getInternalId(): string
  • internal

    Returns string

getIsDirty

  • getIsDirty(): boolean
  • Gets a value indicating whether this instance is dirty.
    internal

    Returns boolean

getIsInTerminatingOrTerminatedState

  • getIsInTerminatingOrTerminatedState(): boolean
  • internal

    Returns boolean

getIsSerialized

  • getIsSerialized(): boolean

Abstract getLocalDescription

  • getLocalDescription(): SessionDescription
  • Gets the local description.

    Returns SessionDescription

Abstract getRemoteDescription

  • getRemoteDescription(): SessionDescription
  • Gets the remote description.

    Returns SessionDescription

getSerialized

  • getSerialized(): string

getSignallingState

  • getSignallingState(): SignallingState
  • Gets the state of the signalling.

    Returns SignallingState

getState

  • getState(): ConnectionState
  • Gets the state of the connection.

    Returns ConnectionState

Abstract getStats

  • getStats(): Future<ConnectionStats>
  • Gets the current connection stats.

    Returns Future<ConnectionStats>

getStream

  • getStream(): TStream
  • Gets the first stream.

    Returns TStream

Abstract getStreams

  • getStreams(): TStream[]
  • Gets the streams.

    Returns TStream[]

getTieBreaker

  • getTieBreaker(): string
  • Gets the tie breaker.

    Returns string

getTimeout

  • getTimeout(): number
  • Gets the amount of time (in milliseconds) to wait for a connection to establish before giving up and closing it. Defaults to 30,000.

    Returns number

getTrickleIcePolicy

  • getTrickleIcePolicy(): TrickleIcePolicy

getTypeString

  • getTypeString(): string

getUseTrickleIce

  • getUseTrickleIce(): boolean
  • internal

    Returns boolean

getVideoStream

  • getVideoStream(): TVideoStream
  • Gets the first video stream.

    Returns TVideoStream

Abstract getVideoStreams

  • getVideoStreams(): TVideoStream[]
  • Gets the video streams.

    Returns TVideoStream[]

Private initializeBase

  • initializeBase(): void
  • internal

    Returns void

Protected processDescription

  • processDescription(description: SessionDescription, isLocalDescription: boolean): Error
  • Processes a session description.

    Parameters

    • description: SessionDescription

      The session description.

    • isLocalDescription: boolean

      Whether this is a local session description.

    Returns Error

Protected Abstract processSdpMediaDescription

  • processSdpMediaDescription(stream: TStream, sdpMediaDescription: MediaDescription, sdpMediaIndex: number, isLocalDescription: boolean, isRenegotiation: boolean): Error
  • Processes a media description.

    Parameters

    • stream: TStream

      The stream.

    • sdpMediaDescription: MediaDescription

      The SDP media description.

    • sdpMediaIndex: number

      The SDP media index.

    • isLocalDescription: boolean

      Flag indicating if this is a local Sdp description.

    • isRenegotiation: boolean

      Flag indicating whether SDP renegotiation is currently in progress.

    Returns Error

Abstract processStateChange

  • processStateChange(): void
  • internal

    Returns void

raiseCachedCandidates

  • raiseCachedCandidates(): void
  • internal

    Returns void

Protected raiseGatheringStateChange

  • raiseGatheringStateChange(connection: TConnection): void
  • Raises gathering state change.

    Parameters

    • connection: TConnection

    Returns void

Protected raiseIceConnectionStateChange

  • raiseIceConnectionStateChange(connection: TConnection): void
  • Raises ICE connection state change.

    Parameters

    • connection: TConnection

    Returns void

Protected raiseLocalCandidate

  • raiseLocalCandidate(localCandidate: Candidate): void
  • Raises a local candidate but only if it has not been already raised.

    Parameters

    • localCandidate: Candidate

      The local candidate.

    Returns void

Private raiseLocalDescription

  • raiseLocalDescription(localDescription: SessionDescription): void
  • internal

    Parameters

    • localDescription: SessionDescription

    Returns void

Private raiseRemoteCandidate

  • raiseRemoteCandidate(remoteCandidate: Candidate): void
  • internal

    Parameters

    • remoteCandidate: Candidate

    Returns void

Private raiseRemoteDescription

  • raiseRemoteDescription(remoteDescription: SessionDescription): void
  • internal

    Parameters

    • remoteDescription: SessionDescription

    Returns void

Private raiseStateChange

  • raiseStateChange(): void
  • internal

    Returns void

removeIceServer

  • removeIceServer(iceServer: IceServer): void
  • Removes an ICE server.

    Parameters

    • iceServer: IceServer

      The ICE server.

    Returns void

removeIceServers

  • removeIceServers(iceServers: IceServer[]): void
  • Removes some ICE servers.

    Parameters

    • iceServers: IceServer[]

      The ICE servers.

    Returns void

removeOnGatheringStateChange

  • removeOnGatheringStateChange(value: IAction1<TConnection>): void
  • Removes a handler that is raised when the gathering state changes.

    Parameters

    • value: IAction1<TConnection>

    Returns void

removeOnIceConnectionStateChange

  • removeOnIceConnectionStateChange(value: IAction1<TConnection>): void
  • Removes a handler that is raised when the ice connection state changes.

    Parameters

    • value: IAction1<TConnection>

    Returns void

removeOnLocalCandidate

  • removeOnLocalCandidate(value: IAction2<TConnection, Candidate>): void
  • Removes a handler that is raised when a local candidate is added.

    Parameters

    • value: IAction2<TConnection, Candidate>

    Returns void

removeOnLocalDescription

  • removeOnLocalDescription(value: IAction2<TConnection, SessionDescription>): void
  • Removes a handler that is raised when a local description is set.

    Parameters

    • value: IAction2<TConnection, SessionDescription>

    Returns void

removeOnRemoteCandidate

  • removeOnRemoteCandidate(value: IAction2<TConnection, Candidate>): void
  • Removes a handler that is raised when a remote description is added.

    Parameters

    • value: IAction2<TConnection, Candidate>

    Returns void

removeOnRemoteDescription

  • removeOnRemoteDescription(value: IAction2<TConnection, SessionDescription>): void
  • Removes a handler that is raised when a remote description is set.

    Parameters

    • value: IAction2<TConnection, SessionDescription>

    Returns void

removeOnSignallingStateChange

  • removeOnSignallingStateChange(value: IAction1<TConnection>): void
  • Removes a handler that is raised when the signalling state changes.

    Parameters

    • value: IAction1<TConnection>

    Returns void

removeOnStateChange

  • removeOnStateChange(value: IAction1<TConnection>): void
  • Removes a handler that is raised when the connection state changes.

    Parameters

    • value: IAction1<TConnection>

    Returns void

setDeadStreamTimeout

  • setDeadStreamTimeout(value: number): void
  • Sets the amount of time (in milliseconds) to wait for connectivity checks to re-establish after they start to fail on a live connection. Defaults to 15,000.

    Parameters

    • value: number

    Returns void

setDynamicProperties

  • setDynamicProperties(value: Hash<string, Object>): void
  • internal

    Parameters

    • value: Hash<string, Object>

    Returns void

setDynamicValue

  • setDynamicValue(key: string, value: Object): void
  • Sets a property value in the local cache.

    Parameters

    • key: string

      The property key. This key is used internally only, but should be namespaced to avoid conflict with third-party extensions.

    • value: Object

      The property value. This can be any object that needs to be stored for future use.

    Returns void

Protected setError

  • setError(value: Error): void
  • Sets the error.

    Parameters

    • value: Error

    Returns void

Protected Abstract setGatheringState

  • setGatheringState(value: IceGatheringState): void
  • Sets the ICE gathering state.

    Parameters

    • value: IceGatheringState

    Returns void

Protected Abstract setIceConnectionState

  • setIceConnectionState(value: IceConnectionState): void
  • Sets the ICE connection state.

    Parameters

    • value: IceConnectionState

    Returns void

setIceGatherPolicy

  • setIceGatherPolicy(value: IceGatherPolicy): void
  • Sets the ICE gather policy.

    Parameters

    • value: IceGatherPolicy

    Returns void

setIceServer

  • setIceServer(value: IceServer): void
  • Sets the ICE server.

    Parameters

    • value: IceServer

    Returns void

setIceServers

  • setIceServers(value: IceServer[]): void
  • Sets the ICE servers.

    Parameters

    • value: IceServer[]

    Returns void

setId

  • setId(value: string): void
  • Sets the identifier.

    Parameters

    • value: string

    Returns void

Private setInternalId

  • setInternalId(value: string): void
  • internal

    Parameters

    • value: string

    Returns void

setIsDirty

  • setIsDirty(value: boolean): void
  • Sets a value indicating whether this instance is dirty.
    internal

    Parameters

    • value: boolean

    Returns void

setIsSerialized

  • setIsSerialized(value: boolean): void
  • internal

    Parameters

    • value: boolean

    Returns void

setLocalDescription

  • setLocalDescription(localDescription: SessionDescription): Future<SessionDescription>
  • Sets the local description.

    Parameters

    • localDescription: SessionDescription

      The local description.

    Returns Future<SessionDescription>

setRemoteDescription

  • setRemoteDescription(remoteDescription: SessionDescription): Future<SessionDescription>
  • Sets the remote description.

    Parameters

    • remoteDescription: SessionDescription

      The remote description.

    Returns Future<SessionDescription>

setSerialized

  • setSerialized(value: string): void
  • internal

    Parameters

    • value: string

    Returns void

Protected setSignallingState

  • setSignallingState(value: SignallingState): void
  • Sets the state of the signalling.

    Parameters

    • value: SignallingState

    Returns void

Protected setState

  • setState(value: ConnectionState): void
  • Sets the state of the connection.

    Parameters

    • value: ConnectionState

    Returns void

setTieBreaker

  • setTieBreaker(value: string): void
  • Sets the tie breaker.

    Parameters

    • value: string

    Returns void

setTimeout

  • setTimeout(value: number): void
  • Sets the amount of time (in milliseconds) to wait for a connection to establish before giving up and closing it. Defaults to 30,000.

    Parameters

    • value: number

    Returns void

setTrickleIcePolicy

  • setTrickleIcePolicy(value: TrickleIcePolicy): void

setUseTrickleIce

  • setUseTrickleIce(value: boolean): void
  • internal

    Parameters

    • value: boolean

    Returns void

unsetDynamicValue

  • unsetDynamicValue(key: string): boolean
  • Unsets a property value in the local cache.

    Parameters

    • key: string

      The property key. This key is used internally only, but should be namespaced to avoid conflict with third-party extensions.

    Returns boolean

    true if the value was removed; otherwise, false.

Private verifySessionIdAndVersion

  • verifySessionIdAndVersion(promise: Promise<SessionDescription>, remoteDescription: SessionDescription): boolean
  • internal

    Parameters

    • promise: Promise<SessionDescription>
    • remoteDescription: SessionDescription

    Returns boolean