Compartilhar via


StatefulCallClient interface

Define os métodos que permitem que o CallClient <xref:%40azure%2Fcommunication-calling%23CallClient> seja usado com estado. A interface fornece acesso ao estado com proxie e também permite registrar um manipulador para eventos de alteração de estado. Para definição de estado, consulte CallClientState.

Os eventos de alteração de estado são orientados por:

  • Dados retornados de APIs de <xref:%40azure%2Fcommunication-calling%23DeviceManager>.
  • Dados retornados de APIs de <xref:%40azure%2Fcommunication-calling%23CallAgent>.
  • Ouvintes anexados automaticamente a vários objetos de chamada de comunicação do Azure:
    • CallAgent 'incomingCall'
    • CallAgent 'callsUpdated'
    • DeviceManager 'videoDevicesUpdated'
    • DeviceManager 'audioDevicesUpdated
    • DeviceManager 'selectedMicrophoneChanged'
    • DeviceManager 'selectedSpeakerChanged'
    • Chamar 'stateChanged'
    • Chamar 'idChanged'
    • Chamar 'isMutedChanged'
    • Chamar 'isScreenSharingOnChanged'
    • Chamar 'remoteParticipantsUpdated'
    • Chamar 'localVideoStreamsUpdated'
    • IncomingCall 'callEnded'
    • RemoteParticipant 'stateChanged'
    • RemoteParticipant 'isMutedChanged'
    • RemoteParticipant 'displayNameChanged'
    • RemoteParticipant 'isSpeakingChanged'
    • RemoteParticipant 'videoStreamsUpdated'
    • RemoteVideoStream 'isAvailableChanged'
    • TranscriptionCallFeature 'isTranscriptionActiveChanged'
    • RecordingCallFeature 'isRecordingActiveChanged'
    • LocalRecordingCallFeature 'isLocalRecordingActiveChanged'
    • RaiseHandCallFeature 'raiadoHandEvent'
    • RaiseHandCallFeature 'loweredHandEvent'
    • PPTLiveCallFeature 'isAciveChanged'
    • ReactionCallFeature 'reação'
Extends

Métodos

createCallAgent([tokenCredential, options])

O CallAgent é usado para lidar com chamadas. Para criar o CallAgent, passe um objeto CommunicationTokenCredential fornecido do SDK.

  • O CallClient só pode ter uma instância de CallAgent ativa por vez.
  • Você pode criar uma nova instância callclient para criar um novo CallAgent.
  • Você pode descartar o CallAgent ativo atual de um CallClient e chamar o método createCallAgent() do CallClient novamente para criar um novo CallAgent.
createTeamsCallAgent([tokenCredential, options])

O TeamsCallAgent é usado para lidar com chamadas. Para criar o TeamsCallAgent, passe um objeto CommunicationTokenCredential fornecido do SDK.

  • O CallClient só pode ter uma instância ativa do TeamsCallAgent por vez.
  • Você pode criar uma nova instância de CallClient para criar um novo TeamsCallAgent.
  • Você pode descartar o TeamsCallAgent ativo atual de um CallClient e chamar o método createTeamsCallAgent() do CallClient novamente para criar um novo TeamsCallAgent.
createView(undefined | string, undefined | CommunicationIdentifier, CallFeatureStreamState | RemoteVideoStreamState | LocalVideoStreamState, CreateViewOptions)

Renderiza um RemoteVideoStreamState ou LocalVideoStreamState e armazena o VideoStreamRendererViewState resultante no RemoteVideoStreamState ou localVideoStreamState ou como modo de exibição não especificado no estado. Sob o capô chama <xref:%40azure%2Fcommunication-calling%23VideoStreamRenderer.createView>.

Cenário 1: Renderizar RemoteVideoStreamState

  • CallId é necessário, participantId é necessário e fluxo do tipo RemoteVideoStreamState é necessário
  • O VideoStreamRendererViewState resultante é armazenado no callId e no participantId especificados em CallClientState

Cenário 2: Renderizar LocalVideoStreamState para uma chamada

  • CallId é necessário, participantId deve ser indefinido e fluxo do tipo LocalVideoStreamState é necessário.

  • O <xref:%40azure%2Fcommunication-calling%23Call.localVideoStreams> já deve ser iniciado usando <xref:%40azure%2Fcommunication-calling%23Call.startVideo>.

  • O VideoStreamRendererViewState resultante é armazenado no callId localVideoStreams em CallClientState.

  • Cenário 2: Renderizar LocalVideoStreamState não faz parte de uma chamada (exemplo de câmera de renderização para visualização local)

  • CallId deve ser indefinido, participantId deve ser indefinido e fluxo do tipo LocalVideoStreamState é necessário.

  • O VideoStreamRendererViewState resultante é armazenado no LocalVideoStreamState especificado em <xref:CallClientState.deviceManager.unparentedViews>

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

Para de renderizar um RemoteVideoStreamState ou LocalVideoStreamState e remove o <xref:VideoStreamRendererView> do RemoteVideoStreamState relevante em CallClientState ou <xref:LocalVideoStream> no CallClientState ou <xref:CallClientState.deviceManager.unparentedViews> apropriado sob as chamadas de hood <xref:%40azure%2Fcommunication-calling%23VideoStreamRenderer.dispose>.

É importante descartar oView para limpar os recursos corretamente.

Cenário 1: Descartar RemoteVideoStreamState

  • CallId é necessário, participantId é necessário e fluxo do tipo RemoteVideoStreamState é necessário

Cenário 2: Descartar LocalVideoStreamState para uma chamada

  • CallId é necessário, participantId deve ser indefinido e fluxo do tipo LocalVideoStreamState é necessário.

  • Cenário 2: Descartar LocalVideoStreamState não faz parte de uma chamada

  • CallId deve ser indefinido, participantId deve ser indefinido e fluxo do tipo LocalVideoStreamState é necessário.

  • LocalVideoStreamState deve ser o original passado para createView.

getState()

Mantém todo o estado que poderíamos fazer proxy de CallClient <xref:%40azure%2Fcommunication-calling%23CallClient> como CallClientState CallClientState.

offStateChange((state: CallClientState) => void)

Permite o cancelamento do registro de eventos 'stateChanged'.

onStateChange((state: CallClientState) => void)

Permite que um manipulador seja registrado para eventos 'stateChanged'.

Métodos herdados

dispose()

Elimina esse CallClient que também descarta o gerenciador de dispositivos associado e o agente de chamadas associado.

feature<TFeature>(CallClientFeatureFactory<TFeature>)

Recupera um objeto Feature inicializado e memorando com a API estendida. Verifique o objeto Features.* para obter todos os recursos de cliente de chamada estendida disponíveis neste pacote.

getDeviceManager()

O DeviceManager é usado para lidar com dispositivos de mídia, como câmeras, microfones e alto-falantes.

Detalhes do método

createCallAgent([tokenCredential, options])

O CallAgent é usado para lidar com chamadas. Para criar o CallAgent, passe um objeto CommunicationTokenCredential fornecido do SDK.

  • O CallClient só pode ter uma instância de CallAgent ativa por vez.
  • Você pode criar uma nova instância callclient para criar um novo CallAgent.
  • Você pode descartar o CallAgent ativo atual de um CallClient e chamar o método createCallAgent() do CallClient novamente para criar um novo CallAgent.
function createCallAgent(args: [tokenCredential, options]): Promise<DeclarativeCallAgent>

Parâmetros

args

[tokenCredential, options]

Retornos

createTeamsCallAgent([tokenCredential, options])

O TeamsCallAgent é usado para lidar com chamadas. Para criar o TeamsCallAgent, passe um objeto CommunicationTokenCredential fornecido do SDK.

  • O CallClient só pode ter uma instância ativa do TeamsCallAgent por vez.
  • Você pode criar uma nova instância de CallClient para criar um novo TeamsCallAgent.
  • Você pode descartar o TeamsCallAgent ativo atual de um CallClient e chamar o método createTeamsCallAgent() do CallClient novamente para criar um novo TeamsCallAgent.
function createTeamsCallAgent(args: [tokenCredential, options]): Promise<DeclarativeTeamsCallAgent>

Parâmetros

args

[tokenCredential, options]

Retornos

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

Renderiza um RemoteVideoStreamState ou LocalVideoStreamState e armazena o VideoStreamRendererViewState resultante no RemoteVideoStreamState ou localVideoStreamState ou como modo de exibição não especificado no estado. Sob o capô chama <xref:%40azure%2Fcommunication-calling%23VideoStreamRenderer.createView>.

Cenário 1: Renderizar RemoteVideoStreamState

  • CallId é necessário, participantId é necessário e fluxo do tipo RemoteVideoStreamState é necessário
  • O VideoStreamRendererViewState resultante é armazenado no callId e no participantId especificados em CallClientState

Cenário 2: Renderizar LocalVideoStreamState para uma chamada

  • CallId é necessário, participantId deve ser indefinido e fluxo do tipo LocalVideoStreamState é necessário.

  • O <xref:%40azure%2Fcommunication-calling%23Call.localVideoStreams> já deve ser iniciado usando <xref:%40azure%2Fcommunication-calling%23Call.startVideo>.

  • O VideoStreamRendererViewState resultante é armazenado no callId localVideoStreams em CallClientState.

  • Cenário 2: Renderizar LocalVideoStreamState não faz parte de uma chamada (exemplo de câmera de renderização para visualização local)

  • CallId deve ser indefinido, participantId deve ser indefinido e fluxo do tipo LocalVideoStreamState é necessário.

  • O VideoStreamRendererViewState resultante é armazenado no LocalVideoStreamState especificado em <xref:CallClientState.deviceManager.unparentedViews>

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

Parâmetros

callId

undefined | string

CallId para o fluxo fornecido. Pode ser indefinido se o fluxo não fizer parte de nenhuma chamada.

participantId

undefined | CommunicationIdentifier

<xref:RemoteParticipant.identifier> associado ao RemoteVideoStreamState especificado. Pode ser indefinido se estiver renderizando LocalVideoStreamState.

stream

CallFeatureStreamState | RemoteVideoStreamState | LocalVideoStreamState

O LocalVideoStreamState ou RemoteVideoStreamState para iniciar a renderização.

options
CreateViewOptions

Opções passadas para o <xref:%40azure%2Fcommunication-calling%23VideoStreamRenderer>.

Retornos

Promise<undefined | CreateViewResult>

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

Para de renderizar um RemoteVideoStreamState ou LocalVideoStreamState e remove o <xref:VideoStreamRendererView> do RemoteVideoStreamState relevante em CallClientState ou <xref:LocalVideoStream> no CallClientState ou <xref:CallClientState.deviceManager.unparentedViews> apropriado sob as chamadas de hood <xref:%40azure%2Fcommunication-calling%23VideoStreamRenderer.dispose>.

É importante descartar oView para limpar os recursos corretamente.

Cenário 1: Descartar RemoteVideoStreamState

  • CallId é necessário, participantId é necessário e fluxo do tipo RemoteVideoStreamState é necessário

Cenário 2: Descartar LocalVideoStreamState para uma chamada

  • CallId é necessário, participantId deve ser indefinido e fluxo do tipo LocalVideoStreamState é necessário.

  • Cenário 2: Descartar LocalVideoStreamState não faz parte de uma chamada

  • CallId deve ser indefinido, participantId deve ser indefinido e fluxo do tipo LocalVideoStreamState é necessário.

  • LocalVideoStreamState deve ser o original passado para createView.

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

Parâmetros

callId

undefined | string

CallId para o fluxo fornecido. Pode ser indefinido se o fluxo não fizer parte de nenhuma chamada.

participantId

undefined | CommunicationIdentifier

<xref:RemoteParticipant.identifier> associado ao RemoteVideoStreamState especificado. Pode ser indefinido se estiver descartando LocalVideoStreamState.

stream

CallFeatureStreamState | RemoteVideoStreamState | LocalVideoStreamState

O LocalVideoStreamState ou RemoteVideoStreamState a ser descartado.

getState()

Mantém todo o estado que poderíamos fazer proxy de CallClient <xref:%40azure%2Fcommunication-calling%23CallClient> como CallClientState CallClientState.

function getState(): CallClientState

Retornos

offStateChange((state: CallClientState) => void)

Permite o cancelamento do registro de eventos 'stateChanged'.

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

Parâmetros

handler

(state: CallClientState) => void

Retorno de chamada original a ser cancelado.

onStateChange((state: CallClientState) => void)

Permite que um manipulador seja registrado para eventos 'stateChanged'.

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

Parâmetros

handler

(state: CallClientState) => void

Retorno de chamada para receber o estado.

Detalhes do método herdado

dispose()

Elimina esse CallClient que também descarta o gerenciador de dispositivos associado e o agente de chamadas associado.

function dispose(): Promise<void>

Retornos

Promise<void>

Herdado de CallClient.dispose

feature<TFeature>(CallClientFeatureFactory<TFeature>)

Recupera um objeto Feature inicializado e memorando com a API estendida. Verifique o objeto Features.* para obter todos os recursos de cliente de chamada estendida disponíveis neste pacote.

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

Parâmetros

factory

CallClientFeatureFactory<TFeature>

A fábrica do construtor de recursos de cliente de chamada que fornece uma API estendida.

Retornos

TFeature

Herdado de CallClient.feature

getDeviceManager()

O DeviceManager é usado para lidar com dispositivos de mídia, como câmeras, microfones e alto-falantes.

function getDeviceManager(): Promise<DeviceManager>

Retornos

Promise<DeviceManager>

herdado de CallClient.getDeviceManager