@ceeblue/webrtc-client
    Preparing search index...

    Class SIPConnectorAbstract

    SIPConnector is a common abstract class for negotiating a new RTCPeerConnection connection with the server.

    The child class must implement the _sip method to send the offer to the server and get the answer.

    Hierarchy (View Summary)

    Implements

    Index

    Constructors

    • Create a new SIPConnector instance. The RTCPeerConnection is created only when calling _open().

      By default, a listener channel is negotiated. To create a streamer channel, pass a stream parameter.

      Parameters

      • connectParams: Params
      • Optionalstream: MediaStream

      Returns SIPConnector

    Properties

    log: ILog

    Start a log

    a Log object with the levels of log to call

    Accessors

    • get stream(): MediaStream | undefined

      Media Stream description delivred from the server if we are player, or build from the local camera if we are the streamer.

      Returns MediaStream | undefined

    Methods

    • Main function which creates the RTCPeerConnection, creates the offer, calls the _sip method, then set the answer and calls onOpen

      Parameters

      • OptionaliceServer: RTCIceServer

      Returns void

    • Operates Session Initiation Protocol, this method implement the logic to send the SDP offer to the server and get the SDP answer in response.

      Parameters

      • offer: string

        SIP Offer

      Returns Promise<string>

      a Promise with SIP Answer as result

    • Event unsubscription

      Parameters

      • name: "close" | "Close" | "Open" | "open"

        Name of event without the 'on' prefix (ex: 'log' to 'onLog' event declared)

      • event: Function

        Unsubscriber Function, must be the one passed to on or once subscription methods

      Returns boolean

    • Event subscription

      Parameters

      • name: "close" | "Close" | "Open" | "open"

        Name of event without the on prefix (ex: log to onLog event declared)

      • event: Function

        Subscriber Function

      • Optionaloptions: { signal?: AbortSignal }
        • Optionalsignal?: AbortSignal

          Optional AbortSignal to stop this or multiple subscriptions in same time

      Returns void

    • Event subscription only one time, once time fired it's automatically unsubscribe

      Parameters

      • name: "close" | "Close" | "Open" | "open"

        Name of event without the on prefix (ex: log to onLog event declared)

      • event: Function

        Subscriber Function

      • Optionaloptions: { signal?: AbortSignal }
        • Optionalsignal?: AbortSignal

          Optional AbortSignal to stop this or multiple subscriptions in same time

      Returns void

    • Hot-swap a track on the existing RTCPeerConnection without renegotiation.

      Parameters

      • kind: "audio" | "video"

        'audio' | 'video'

      • track: MediaStreamTrack | null

        A MediaStreamTrack to send, or null to stop sending that kind.

      Returns Promise<void>

    Events

    • Call when connector is open

      Parameters

      • stream: MediaStream

        MediaStream description provided from the server if we are the player, or build from the local camera if we are the streamer.

      Returns void