次の方法で共有


StatefulCallClient interface

CallClient <xref:%40azure%2Fcommunication-calling%23CallClient> をステートフルに使用できるようにするメソッドを定義します。 インターフェイスは、プロキシされた状態へのアクセスを提供し、状態変更イベントのハンドラーを登録することもできます。 状態定義については、CallClientState 参照してください。

状態変更イベントは、次の方法で実行されます。

  • <xref:%40azure%2Fcommunication-calling%23DeviceManager> API から返されたデータ。
  • <xref:%40azure%2Fcommunication-calling%23CallAgent> API から返されたデータ。
  • リスナーは、さまざまな Azure 通信呼び出し元オブジェクトに自動的にアタッチされます。
    • CallAgent '着信コール'
    • CallAgent 'callsUpdated'
    • デバイスマネージャ 'videoDevicesUpdated'
    • DeviceManager 'audioDevicesUpdated
    • デバイスマネージャー 'selectedMicrophoneChanged'
    • DeviceManager 'selectedSpeakerChanged'
    • 'stateChanged' を呼び出す
    • 'idChanged' を呼び出す
    • 'isMutedChanged' を呼び出す
    • 'isScreenSharingOnChanged' を呼び出す
    • 'remoteParticipantsUpdated' を呼び出す
    • 'localVideoStreamsUpdated' を呼び出す
    • 着信コール 'callEnded'
    • RemoteParticipant '状態が変更されました'
    • RemoteParticipant 'isMutedChanged'
    • RemoteParticipant 'displayNameChanged'
    • RemoteParticipant 'isSpeakingChanged'
    • RemoteParticipant 'videoStreamsUpdated'
    • RemoteVideoStream 'isAvailableChanged'
    • TranscriptionCallFeature 'isTranscriptionActiveChanged'
    • RecordingCallFeature 'isRecordingActiveChanged'
    • LocalRecordingCallFeature 'isLocalRecordingActiveChanged'
    • RaiseHandCallFeature 'raisedHandEvent'
    • RaiseHandCallFeature 'loweredHandEvent'
    • PPTLiveCallFeature 'isAciveChanged'
    • ReactionCallFeature 'reaction'
Extends

メソッド

createCallAgent([tokenCredential, options])

CallAgent は、呼び出しを処理するために使用されます。 CallAgent を作成するには、SDK から提供される CommunicationTokenCredential オブジェクトを渡します。

  • CallClient は、一度に 1 つのアクティブな CallAgent インスタンスのみを持つことができます。
  • 新しい CallClient インスタンスを作成して、新しい CallAgent を作成できます。
  • CallClient の現在のアクティブな CallAgent を破棄し、CallClient の createCallAgent() メソッドを再度呼び出して新しい CallAgent を作成できます。
createTeamsCallAgent([tokenCredential, options])

TeamsCallAgent は、通話の処理に使用されます。 TeamsCallAgent を作成するには、SDK から提供される CommunicationTokenCredential オブジェクトを渡します。

  • CallClient は、一度に 1 つのアクティブな TeamsCallAgent インスタンスのみを持つことができます。
  • 新しい CallClient インスタンスを作成して、新しい TeamsCallAgent を作成できます。
  • CallClient の現在のアクティブな TeamsCallAgent を破棄し、CallClient の createTeamsCallAgent() メソッドを再度呼び出して、新しい TeamsCallAgent を作成できます。
createView(undefined | string, undefined | CommunicationIdentifier, CallFeatureStreamState | RemoteVideoStreamState | LocalVideoStreamState, CreateViewOptions)

RemoteVideoStreamState または LocalVideoStreamState をレンダリングし、結果の VideoStreamRendererViewState を関連する RemoteVideoStreamState または LocalVideoStreamState の下に格納するか、その状態の親のないビューとして格納します。 ボンネットの下には <xref:%40azure%2Fcommunication-calling%23VideoStreamRenderer.createView>が呼ばれています。

シナリオ 1: RemoteVideoStreamState をレンダリングする

  • CallId、participantId、RemoteVideoStreamStateタイプのストリームが必要です
  • 結果の VideoStreamRendererViewState は、CallClientState の指定された callId と participantId に格納されます

シナリオ 2: 呼び出しの LocalVideoStreamState をレンダリングする

  • CallId は必須で、participantId は未定義で、LocalVideoStreamState 型のストリームが必要です。

  • <xref:%40azure%2Fcommunication-calling%23Call.localVideoStreams>は、<xref:%40azure%2Fcommunication-calling%23Call.startVideo>を使用してすでに開始されている必要があります。

  • 結果の VideoStreamRendererViewState は、CallClientState の指定された callId localVideoStreams に格納されます。

  • シナリオ 2: LocalVideoStreamState を呼び出しの一部にしないレンダリング (ローカル プレビュー用のカメラをレンダリングする例)

  • CallId は未定義、participantId は未定義、LocalVideoStreamState 型のストリームは必須です。

  • 結果の VideoStreamRendererViewState は、指定された LocalVideoStreamState の下に格納されます。 <xref:CallClientState.deviceManager.unparentedViews>

disposeView(undefined | string, undefined | CommunicationIdentifier, CallFeatureStreamState | RemoteVideoStreamState | LocalVideoStreamState)

RemoteVideoStreamState または LocalVideoStreamState のレンダリングを停止し、<xref:VideoStreamRendererView> の関連する RemoteVideoStreamState からを削除するか、<xref:LocalVideoStream> の または適切な<xref:CallClientState.deviceManager.unparentedViews> 内部で <xref:%40azure%2Fcommunication-calling%23VideoStreamRenderer.dispose>を呼び出します。

リソースを適切にクリーンアップするには、disposeViewが重要です。

シナリオ 1: RemoteVideoStreamState を破棄する

  • CallId、participantId、RemoteVideoStreamStateタイプのストリームが必要です

シナリオ 2: 呼び出しの LocalVideoStreamState を破棄する

  • CallId は必須で、participantId は未定義で、LocalVideoStreamState 型のストリームが必要です。

  • シナリオ 2: 呼び出しの一部ではない LocalVideoStreamState を破棄する

  • CallId は未定義、participantId は未定義、LocalVideoStreamState 型のストリームは必須です。

  • LocalVideoStreamState は、createView に渡される元のものである必要があります。

getState()

CallClient からプロキシできるすべての状態を CallClientState <xref:%40azure%2Fcommunication-calling%23CallClient> として保持します。

offStateChange((state: CallClientState) => void)

'stateChanged' イベントの登録解除を許可します。

onStateChange((state: CallClientState) => void)

ハンドラーを 'stateChanged' イベントに登録できるようにします。

継承されたメソッド

dispose()

この CallClient を破棄し、関連付けられているデバイス マネージャーと関連付けられている通話エージェントも破棄します。

feature<TFeature>(CallClientFeatureFactory<TFeature>)

拡張 API を使用して初期化およびメモ化された Feature オブジェクトを取得します。 オブジェクト Features.* で、このパッケージで使用可能なすべての拡張コールクライアント機能を確認します。

getDeviceManager()

DeviceManager は、カメラ、マイク、スピーカーなどのメディア デバイスを処理するために使用されます。

メソッドの詳細

createCallAgent([tokenCredential, options])

CallAgent は、呼び出しを処理するために使用されます。 CallAgent を作成するには、SDK から提供される CommunicationTokenCredential オブジェクトを渡します。

  • CallClient は、一度に 1 つのアクティブな CallAgent インスタンスのみを持つことができます。
  • 新しい CallClient インスタンスを作成して、新しい CallAgent を作成できます。
  • CallClient の現在のアクティブな CallAgent を破棄し、CallClient の createCallAgent() メソッドを再度呼び出して新しい CallAgent を作成できます。
function createCallAgent(args: [tokenCredential, options]): Promise<DeclarativeCallAgent>

パラメーター

args

[tokenCredential, options]

戻り値

createTeamsCallAgent([tokenCredential, options])

TeamsCallAgent は、通話の処理に使用されます。 TeamsCallAgent を作成するには、SDK から提供される CommunicationTokenCredential オブジェクトを渡します。

  • CallClient は、一度に 1 つのアクティブな TeamsCallAgent インスタンスのみを持つことができます。
  • 新しい CallClient インスタンスを作成して、新しい TeamsCallAgent を作成できます。
  • CallClient の現在のアクティブな TeamsCallAgent を破棄し、CallClient の createTeamsCallAgent() メソッドを再度呼び出して、新しい TeamsCallAgent を作成できます。
function createTeamsCallAgent(args: [tokenCredential, options]): Promise<DeclarativeTeamsCallAgent>

パラメーター

args

[tokenCredential, options]

戻り値

createView(undefined | string, undefined | CommunicationIdentifier, CallFeatureStreamState | RemoteVideoStreamState | LocalVideoStreamState, CreateViewOptions)

RemoteVideoStreamState または LocalVideoStreamState をレンダリングし、結果の VideoStreamRendererViewState を関連する RemoteVideoStreamState または LocalVideoStreamState の下に格納するか、その状態の親のないビューとして格納します。 ボンネットの下には <xref:%40azure%2Fcommunication-calling%23VideoStreamRenderer.createView>が呼ばれています。

シナリオ 1: RemoteVideoStreamState をレンダリングする

  • CallId、participantId、RemoteVideoStreamStateタイプのストリームが必要です
  • 結果の VideoStreamRendererViewState は、CallClientState の指定された callId と participantId に格納されます

シナリオ 2: 呼び出しの LocalVideoStreamState をレンダリングする

  • CallId は必須で、participantId は未定義で、LocalVideoStreamState 型のストリームが必要です。

  • <xref:%40azure%2Fcommunication-calling%23Call.localVideoStreams>は、<xref:%40azure%2Fcommunication-calling%23Call.startVideo>を使用してすでに開始されている必要があります。

  • 結果の VideoStreamRendererViewState は、CallClientState の指定された callId localVideoStreams に格納されます。

  • シナリオ 2: LocalVideoStreamState を呼び出しの一部にしないレンダリング (ローカル プレビュー用のカメラをレンダリングする例)

  • CallId は未定義、participantId は未定義、LocalVideoStreamState 型のストリームは必須です。

  • 結果の VideoStreamRendererViewState は、指定された LocalVideoStreamState の下に格納されます。 <xref:CallClientState.deviceManager.unparentedViews>

function createView(callId: undefined | string, participantId: undefined | CommunicationIdentifier, stream: CallFeatureStreamState | RemoteVideoStreamState | LocalVideoStreamState, options?: CreateViewOptions): Promise<undefined | CreateViewResult>

パラメーター

callId

undefined | string

指定されたストリームの CallId。 ストリームがどの呼び出しの一部でもない場合は、未定義にすることができます。

participantId

undefined | CommunicationIdentifier

<xref:RemoteParticipant.identifier> 指定された RemoteVideoStreamState に関連付けられています。 LocalVideoStreamState をレンダリングする場合は、未定義の可能性があります。

stream

CallFeatureStreamState | RemoteVideoStreamState | LocalVideoStreamState

レンダリングを開始する LocalVideoStreamState または RemoteVideoStreamState。

options
CreateViewOptions

<xref:%40azure%2Fcommunication-calling%23VideoStreamRenderer>に渡されるオプション。

戻り値

Promise<undefined | CreateViewResult>

disposeView(undefined | string, undefined | CommunicationIdentifier, CallFeatureStreamState | RemoteVideoStreamState | LocalVideoStreamState)

RemoteVideoStreamState または LocalVideoStreamState のレンダリングを停止し、<xref:VideoStreamRendererView> の関連する RemoteVideoStreamState からを削除するか、<xref:LocalVideoStream> の または適切な<xref:CallClientState.deviceManager.unparentedViews> 内部で <xref:%40azure%2Fcommunication-calling%23VideoStreamRenderer.dispose>を呼び出します。

リソースを適切にクリーンアップするには、disposeViewが重要です。

シナリオ 1: RemoteVideoStreamState を破棄する

  • CallId、participantId、RemoteVideoStreamStateタイプのストリームが必要です

シナリオ 2: 呼び出しの LocalVideoStreamState を破棄する

  • CallId は必須で、participantId は未定義で、LocalVideoStreamState 型のストリームが必要です。

  • シナリオ 2: 呼び出しの一部ではない LocalVideoStreamState を破棄する

  • CallId は未定義、participantId は未定義、LocalVideoStreamState 型のストリームは必須です。

  • LocalVideoStreamState は、createView に渡される元のものである必要があります。

function disposeView(callId: undefined | string, participantId: undefined | CommunicationIdentifier, stream: CallFeatureStreamState | RemoteVideoStreamState | LocalVideoStreamState)

パラメーター

callId

undefined | string

指定されたストリームの CallId。 ストリームがどの呼び出しの一部でもない場合は、未定義にすることができます。

participantId

undefined | CommunicationIdentifier

<xref:RemoteParticipant.identifier> 指定された RemoteVideoStreamState に関連付けられています。 LocalVideoStreamState を破棄する場合は、未定義の可能性があります。

stream

CallFeatureStreamState | RemoteVideoStreamState | LocalVideoStreamState

破棄する LocalVideoStreamState または RemoteVideoStreamState。

getState()

CallClient からプロキシできるすべての状態を CallClientState <xref:%40azure%2Fcommunication-calling%23CallClient> として保持します。

function getState(): CallClientState

戻り値

offStateChange((state: CallClientState) => void)

'stateChanged' イベントの登録解除を許可します。

function offStateChange(handler: (state: CallClientState) => void)

パラメーター

handler

(state: CallClientState) => void

サブスクリプションを解除する元のコールバック。

onStateChange((state: CallClientState) => void)

ハンドラーを 'stateChanged' イベントに登録できるようにします。

function onStateChange(handler: (state: CallClientState) => void)

パラメーター

handler

(state: CallClientState) => void

状態を受け取るコールバック。

継承済みメソッドの詳細

dispose()

この CallClient を破棄し、関連付けられているデバイス マネージャーと関連付けられている通話エージェントも破棄します。

function dispose(): Promise<void>

戻り値

Promise<void>

継承元 CallClient.dispose

feature<TFeature>(CallClientFeatureFactory<TFeature>)

拡張 API を使用して初期化およびメモ化された Feature オブジェクトを取得します。 オブジェクト Features.* で、このパッケージで使用可能なすべての拡張コールクライアント機能を確認します。

function feature<TFeature>(factory: CallClientFeatureFactory<TFeature>): TFeature

パラメーター

factory

CallClientFeatureFactory<TFeature>

拡張 API を提供する呼び出しクライアント機能コンストラクターのファクトリ。

戻り値

TFeature

継承元 CallClient.feature

getDeviceManager()

DeviceManager は、カメラ、マイク、スピーカーなどのメディア デバイスを処理するために使用されます。

function getDeviceManager(): Promise<DeviceManager>

戻り値

Promise<DeviceManager>

継承元 CallClient.getDeviceManager を呼び出します。