зеркало из
1
0
Форкнуть 0
This commit is contained in:
Donald McEachern 2024-10-28 16:15:15 -07:00 коммит произвёл GitHub
Родитель 8def4c2f5a
Коммит 8c773667b3
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: B5690EEEBB952194
1 изменённых файлов: 9 добавлений и 2 удалений

Просмотреть файл

@ -78,6 +78,7 @@ The following snippet is an example of how you might import the `CallComposite`
```ts
import { Component } from '@angular/core';
import { CallCompositeOptions } from '@azure/communication-react';
import { AzureCommunicationTokenCredential, CommunicationUserIdentifier } from '@azure/communication-common';
@Component({
selector: 'app-calling',
@ -108,15 +109,21 @@ export class CallingComponent {
* We want to fetch a reference to the container element where the call composite will be rendered.
*/
const compositeContainer = document.getElementById('call-composite-container');
/**
* We want to construct the identifier and credential for the local user
*/
const identifier = fromFlatCommunicationIdentifier(this.userId);
const credential = new AzureCommunicationTokenCredential(this.token);
/**
* we only want to call this if the container element is available.
*/
if (compositeContainer) {
this.adapter = await communicationreact
.loadCallComposite(
{
userId: this.userId,
token: this.token,
userId: identifier as CommunicationUserIdentifier,
credential: credential,
displayName: this.displayName,
locator: {
groupId: this.groupId