Options
All
  • Public
  • Public/Protected
  • All
Menu

@sora/sdk

Index

Type Aliases

AudioCodecType: "OPUS"
Callbacks: { addstream: any; datachannel: any; disconnect: any; log: any; message: any; notify: any; push: any; removestream: any; removetrack: any; signaling: any; timeline: any; timeout: any; track: any }

Type declaration

ConnectionOptions: { audio?: boolean; audioBitRate?: number; audioCodecType?: AudioCodecType; audioOpusParamsChannels?: number; audioOpusParamsClockRate?: number; audioOpusParamsMaxplaybackrate?: number; audioOpusParamsMinptime?: number; audioOpusParamsPtime?: number; audioOpusParamsSpropStereo?: boolean; audioOpusParamsStereo?: boolean; audioOpusParamsUsedtx?: boolean; audioOpusParamsUseinbandfec?: boolean; bundleId?: string; clientId?: string; connectionTimeout?: number; dataChannelSignaling?: boolean; dataChannels?: DataChannelConfiguration[]; disconnectWaitTimeout?: number; e2ee?: boolean; ignoreDisconnectWebSocket?: boolean; multistream?: boolean; signalingCandidateTimeout?: number; signalingNotifyMetadata?: JSONType; simulcast?: boolean; simulcastRid?: SimulcastRid; spotlight?: boolean; spotlightFocusRid?: SpotlightFocusRid; spotlightNumber?: number; spotlightUnfocusRid?: SpotlightFocusRid; timeout?: number; video?: boolean; videoBitRate?: number; videoCodecType?: VideoCodecType }

Type declaration

  • Optional audio?: boolean
  • Optional audioBitRate?: number
  • Optional audioCodecType?: AudioCodecType
  • Optional audioOpusParamsChannels?: number
  • Optional audioOpusParamsClockRate?: number
  • Optional audioOpusParamsMaxplaybackrate?: number
  • Optional audioOpusParamsMinptime?: number
  • Optional audioOpusParamsPtime?: number
  • Optional audioOpusParamsSpropStereo?: boolean
  • Optional audioOpusParamsStereo?: boolean
  • Optional audioOpusParamsUsedtx?: boolean
  • Optional audioOpusParamsUseinbandfec?: boolean
  • Optional bundleId?: string
  • Optional clientId?: string
  • Optional connectionTimeout?: number
  • Optional dataChannelSignaling?: boolean
  • Optional dataChannels?: DataChannelConfiguration[]
  • Optional disconnectWaitTimeout?: number
  • Optional e2ee?: boolean
  • Optional ignoreDisconnectWebSocket?: boolean
  • Optional multistream?: boolean
  • Optional signalingCandidateTimeout?: number
  • Optional signalingNotifyMetadata?: JSONType
  • Optional simulcast?: boolean
  • Optional simulcastRid?: SimulcastRid
  • Optional spotlight?: boolean
  • Optional spotlightFocusRid?: SpotlightFocusRid
  • Optional spotlightNumber?: number
  • Optional spotlightUnfocusRid?: SpotlightFocusRid
  • Optional timeout?: number
  • Optional video?: boolean
  • Optional videoBitRate?: number
  • Optional videoCodecType?: VideoCodecType
DataChannelConfiguration: { compress?: boolean; direction: DataChannelDirection; label: string; maxPacketLifeTime?: number; maxRetransmits?: number; ordered?: boolean; protocol?: string }

Type declaration

  • Optional compress?: boolean
  • direction: DataChannelDirection
  • label: string
  • Optional maxPacketLifeTime?: number
  • Optional maxRetransmits?: number
  • Optional ordered?: boolean
  • Optional protocol?: string
DataChannelDirection: "sendonly" | "sendrecv" | "recvonly"
JSONType: null | boolean | number | string | JSONType[] | {}
Role: "sendrecv" | "sendonly" | "recvonly"
SignalingNotifyConnectionCreated: { audio?: boolean; authn_metadata?: JSONType; authz_metadata?: JSONType; channel_connections: number; channel_recvonly_connections: number; channel_sendonly_connections: number; channel_sendrecv_connections: number; client_id?: string; connection_id?: string; data?: SignalingNotifyMetadata[]; event_type: "connection.created"; metadata?: JSONType; metadata_list?: SignalingNotifyMetadata[]; minutes: number; role: Role; turn_transport_type: "udp" | "tcp"; type: "notify"; video?: boolean }

Type declaration

  • Optional audio?: boolean
  • Optional authn_metadata?: JSONType
  • Optional authz_metadata?: JSONType
  • channel_connections: number
  • channel_recvonly_connections: number
  • channel_sendonly_connections: number
  • channel_sendrecv_connections: number
  • Optional client_id?: string
  • Optional connection_id?: string
  • Optional data?: SignalingNotifyMetadata[]
  • event_type: "connection.created"
  • Optional metadata?: JSONType
  • Optional metadata_list?: SignalingNotifyMetadata[]
  • minutes: number
  • role: Role
  • turn_transport_type: "udp" | "tcp"
  • type: "notify"
  • Optional video?: boolean
SignalingNotifyConnectionDestroyed: { audio?: boolean; authn_metadata?: JSONType; authz_metadata?: JSONType; channel_connections: number; channel_recvonly_connections: number; channel_sendonly_connections: number; channel_sendrecv_connections: number; client_id?: string; connection_id?: string; event_type: "connection.destroyed"; metadata?: JSONType; minutes: number; role: Role; turn_transport_type: "udp" | "tcp"; type: "notify"; video?: boolean }

Type declaration

  • Optional audio?: boolean
  • Optional authn_metadata?: JSONType
  • Optional authz_metadata?: JSONType
  • channel_connections: number
  • channel_recvonly_connections: number
  • channel_sendonly_connections: number
  • channel_sendrecv_connections: number
  • Optional client_id?: string
  • Optional connection_id?: string
  • event_type: "connection.destroyed"
  • Optional metadata?: JSONType
  • minutes: number
  • role: Role
  • turn_transport_type: "udp" | "tcp"
  • type: "notify"
  • Optional video?: boolean
SignalingNotifyConnectionUpdated: { audio?: boolean; channel_connections: number; channel_recvonly_connections: number; channel_sendonly_connections: number; channel_sendrecv_connections: number; client_id?: string; connection_id?: string; event_type: "connection.updated"; minutes: number; role: Role; turn_transport_type: "udp" | "tcp"; type: "notify"; video?: boolean }

Type declaration

  • Optional audio?: boolean
  • channel_connections: number
  • channel_recvonly_connections: number
  • channel_sendonly_connections: number
  • channel_sendrecv_connections: number
  • Optional client_id?: string
  • Optional connection_id?: string
  • event_type: "connection.updated"
  • minutes: number
  • role: Role
  • turn_transport_type: "udp" | "tcp"
  • type: "notify"
  • Optional video?: boolean
SignalingNotifyMetadata: { authn_metadata?: JSONType; authz_metadata?: JSONType; client_id?: string; connection_id?: string; metadata?: JSONType }

Type declaration

  • Optional authn_metadata?: JSONType
  • Optional authz_metadata?: JSONType
  • Optional client_id?: string
  • Optional connection_id?: string
  • Optional metadata?: JSONType
SignalingNotifyNetworkStatus: { event_type: "network.status"; type: "notify"; unstable_level: 0 | 1 | 2 | 3 }

Type declaration

  • event_type: "network.status"
  • type: "notify"
  • unstable_level: 0 | 1 | 2 | 3
SignalingNotifySpotlightChanged: { audio: boolean; client_id: string | null; connection_id: string | null; event_type: "spotlight.changed"; fixed?: boolean; spotlight_id: string; type: "notify"; video: boolean }

Type declaration

  • audio: boolean
  • client_id: string | null
  • connection_id: string | null
  • event_type: "spotlight.changed"
  • Optional fixed?: boolean
  • spotlight_id: string
  • type: "notify"
  • video: boolean
SignalingNotifySpotlightFocused: { audio: boolean; client_id: string | null; connection_id: string; event_type: "spotlight.focused"; fixed: boolean; type: "notify"; video: boolean }

Type declaration

  • audio: boolean
  • client_id: string | null
  • connection_id: string
  • event_type: "spotlight.focused"
  • fixed: boolean
  • type: "notify"
  • video: boolean
SignalingNotifySpotlightUnfocused: { audio: boolean; client_id: string | null; connection_id: string; event_type: "spotlight.unfocused"; fixed: boolean; type: "notify"; video: boolean }

Type declaration

  • audio: boolean
  • client_id: string | null
  • connection_id: string
  • event_type: "spotlight.unfocused"
  • fixed: boolean
  • type: "notify"
  • video: boolean
SignalingPushMessage: { data: Record<string, unknown>; type: "push" }

Type declaration

  • data: Record<string, unknown>
  • type: "push"
Simulcast: boolean | { rid: SimulcastRid }
SimulcastRid: "r0" | "r1" | "r2"
SoraAbendTitle: "CONNECTION-STATE-FAILED" | "DATA-CHANNEL-ONERROR" | "ICE-CONNECTION-STATE-DISCONNECTED-TIMEOUT" | "ICE-CONNECTION-STATE-FAILED" | "INTERNAL-ERROR" | "WEBSOCKET-ONCLOSE" | "WEBSOCKET-ONERROR"
SoraCloseEventInitDict: { code?: number; params?: Record<string, unknown>; reason?: string }

Type declaration

  • Optional code?: number
  • Optional params?: Record<string, unknown>
  • Optional reason?: string
SoraCloseEventType: "normal" | "abend"
SpotlightFocusRid: "none" | SimulcastRid
TimelineEventLogType: "websocket" | "datachannel" | "peerconnection" | "sora"
TransportType: "websocket" | "datachannel" | "peerconnection"
VideoCodecType: "VP9" | "VP8" | "AV1" | "H264" | "H265"

Variables

default: { connection: ((signalingUrlCandidates: string | string[], debug?: boolean) => SoraConnection); helpers: { applyMediaStreamConstraints: ((mediastream: MediaStream, constraints: MediaStreamConstraints) => Promise<void>) }; initE2EE: ((wasmUrl: string) => Promise<void>); version: (() => string) }

Sora JS SDK package

Type declaration

  • connection: ((signalingUrlCandidates: string | string[], debug?: boolean) => SoraConnection)
      • (signalingUrlCandidates: string | string[], debug?: boolean): SoraConnection
      • SoraConnection インスタンスを生成するメソッド

        example
        const connection = Sora.connection('ws://192.0.2.100:5000/signaling', true);
        

        Parameters

        • signalingUrlCandidates: string | string[]

          シグナリングに使用する URL 候補

        • debug: boolean = false

          デバッグフラグ

        Returns SoraConnection

  • helpers: { applyMediaStreamConstraints: ((mediastream: MediaStream, constraints: MediaStreamConstraints) => Promise<void>) }

    WebRTC のユーティリティ関数群

    • applyMediaStreamConstraints: ((mediastream: MediaStream, constraints: MediaStreamConstraints) => Promise<void>)
        • (mediastream: MediaStream, constraints: MediaStreamConstraints): Promise<void>
        • MediaStream の constraints を動的に変更するメソッド.

          Parameters

          • mediastream: MediaStream

            メディアストリーム

          • constraints: MediaStreamConstraints

            メディアストリーム制約

          Returns Promise<void>

  • initE2EE: ((wasmUrl: string) => Promise<void>)
      • (wasmUrl: string): Promise<void>
      • E2EE で使用する WASM の読み込みを行うメソッド

        example
        Sora.initE2EE("http://192.0.2.100/wasm.wasm");
        

        Parameters

        • wasmUrl: string

          E2EE WASM の URL

        Returns Promise<void>

  • version: (() => string)
      • (): string
      • SDK のバージョンを返すメソッド

        Returns string

Generated using TypeDoc