Hierarchy

  • Webcaster

Implements

Constructors

  • Parameters

    • config: Config

      imutable. partially optional fields.

    Returns Webcaster

Methods

  • Attempts a single reconnect operation.

    Parameters

    • delay: number

    Returns Promise<boolean>

  • Try to reconnect if it's configured. It's triggered when connection fails

    Returns Promise<boolean>

    Indicates successful reconnection.

  • Full stop - resets everything to the pre-setup phase and stops broadcasting if it's enabled. In order to use the Webcaster instance again - calling setup is required. Can only be called after setup.

    Parameters

    • withMediaStream: boolean = false

    Returns Promise<void>

  • Returns Nullable<MediaStreamConstraints>

  • Return applied settings to the MediaStream. Uses functionality of MediaStreamTrack.getSettings() on both audio and video tracks. Can only be called after setup.

    Returns MediaStreamSettings

    applied settings for audio and video tracks

  • Returns Required<{
        audio?: boolean;
        video?: boolean;
    }>

  • override this at runtime with user-app listener

    Parameters

    • newState: RTCPeerConnectionState

    Returns void

  • override this at runtime with user-app listener

    Parameters

    Returns void

  • override this at runtime with user-app listener

    Parameters

    Returns void

  • override this at runtime with user-app listener

    Parameters

    Returns void

  • override this at runtime with user-app listener

    Returns void

  • Parameters

    • disposeMediaStream: boolean = false

      default is false, when set true will effectively stop all tracks on the current active MediaStream (if any, will not have effect before setup called). If that media-stream was user-provided, this will make the recovery fail therefore (attempting to reuse the thus stopped media-stream for a new broadcast session). Otherwise, a new media-stream is created, eventually based on configured constraint params.

    Returns Promise<void>

  • Adds live meta data to a broadcast stream.

    Parameters

    • handlerName: MetadataHandlerName

      Name of the meta data handler. Other types are not supported.

    • metadata: Record<string, unknown>

      The data to be sent. The parameter can contain a maximum object depth of 6.

    Returns Promise<void>

  • May be called before setup. If not called before, configured value will be applied to MediaStream on setup.

    Parameters

    Returns void

  • Creates media stream if it's not passed. Must be called before any further usage of the API.

    Returns Promise<{
        auth: null | {
            token: string;
        };
        ingestUrl: string;
        inputCfg: {
            broadcastCfg: null | ({ transcodeAudioBitrateBps?: number | undefined; maxVideoBitrateBps?: number | undefined; maxAudioBitrateBps?: number | undefined; maxEncodingFramerate?: number | undefined; });
            mediaStream: null | MediaStream;
            mediaStreamCfg: null | ({ resolution?: [number, number] | undefined; maxFramerate?: number | undefined; audioVideoOnly?: "audio" | "video" | undefined; audioConstraints?: { autoGainControl?: any; echoCancellation?: any; noiseSuppression?: any; channelCount?: any; } | undefined; audioDeviceId?: string | undefined; videoDeviceId?: string | u...);
            muted?: { audio?: boolean | undefined; video?: boolean | undefined; };
        };
        metrics: {
            accountId: string;
            accountKey: string;
        };
        previewVideoElId: null | string;
        reconnect: null | Object;
        serverUrl: string;
        streamName: null | string;
    }>

    mutable clone of internal defaults-applied required config

  • Initiate the starting of broadcast. Actual offer-answer exchange happens here. Can only be called after setup.

    Returns Promise<void>

  • Attach media stream to HTMLVideoElement. Can only be called after setup.

    Parameters

    • Optional videoElId: string

      Optional. If not passed - tries to use Config.previewVideoElId

    Returns void

  • Stop broadcasting by closing the peerConnection. It keeps the posibility to start new broadcasts with existing media stream. Can only be called after setup.

    Returns Promise<void>

Generated using TypeDoc