Table of Contents

Interface IPeerConnection

Namespace
Twikit.Spaces
Assembly
Twikit.dll

WebRTC の RTCPeerConnection の抽象。

public interface IPeerConnection : IAsyncDisposable
Inherited Members

Remarks

.NET 標準には WebRTC の実装が無いため(Python 版は aiortc を使います)、音声経路を使うときは SIPSorcery などでこのインターフェイスを実装し、IPeerConnectionFactory として渡してください。 メタデータ・チャット・コントロール API は実装無しで動作します。

Properties

ConnectionState

接続状態("new"、"connecting"、"connected"、"disconnected"、"failed"、"closed")。

string ConnectionState { get; }

Property Value

string

LocalSdp

現在のローカル SDP。

string? LocalSdp { get; }

Property Value

string

Methods

AddTransceiver(object?, string)

トランシーバーを追加します。track が null なら受信専用("recvonly")。

void AddTransceiver(object? track, string direction)

Parameters

track object
direction string

CloseAsync()

Task CloseAsync()

Returns

Task

CreateAnswerAsync()

SDP answer を作ります。

Task<string> CreateAnswerAsync()

Returns

Task<string>

CreateOfferAsync()

SDP offer を作ります。

Task<string> CreateOfferAsync()

Returns

Task<string>

SetLocalDescriptionAsync(string, string)

Task SetLocalDescriptionAsync(string type, string sdp)

Parameters

type string
sdp string

Returns

Task

SetRemoteDescriptionAsync(string, string)

Task SetRemoteDescriptionAsync(string type, string sdp)

Parameters

type string
sdp string

Returns

Task

Events

ConnectionStateChanged

接続状態が変わったとき。

event Action? ConnectionStateChanged

Event Type

Action

TrackReceived

リモートのトラックを受け取ったとき(実装固有のオブジェクト)。

event Action<object>? TrackReceived

Event Type

Action<object>