Sdílet prostřednictvím


Přihlášení k odběru událostí v knihovně uživatelského rozhraní

Důležité

Tato funkce služeb Azure Communication Services je aktuálně ve verzi Preview.

Rozhraní API a sady SDK verze Preview jsou poskytovány bez smlouvy o úrovni služeb. Doporučujeme je nepoužívat pro produkční úlohy. Některé funkce nemusí být podporované nebo můžou mít omezené možnosti.

Další informace najdete v dodatečných podmínkách použití pro verze Preview Microsoft Azure.

Požadavky

Nastavení funkce

Účastník se připojí k hovoru.

Zveřejňujeme addOnRemoteParticipantJoinedEventHandler naslouchání, pokud se účastník připojí k hovoru.

callComposite.addOnRemoteParticipantJoinedEventHandler { remoteParticipantJoinedEvent -> 
                remoteParticipantJoinedEvent.identifiers.forEach { identifier ->
                    // identifier is communication identifier
                }
            }

Účastník opustil hovor.

Zveřejňujeme addOnRemoteParticipantLeftEventHandler naslouchání, pokud účastník opustí hovor.

callComposite.addOnRemoteParticipantLeftEventHandler { remoteParticipantLeftEvent -> 
                remoteParticipantLeftEvent.identifiers.forEach { identifier ->
                    // identifier is communication identifier
                }
            }

Účastník se připojí k hovoru.

Zveřejňujeme onRemoteParticipantJoined naslouchání, pokud se účastník připojí k hovoru.

let onRemoteParticipantJoinedHandler: ([CommunicationIdentifier]) -> Void = { [weak callComposite] ids in
            guard let composite = callComposite else {
                return
            }
            /// ids are the communication identifiers that has joined and are present in the meeting
        }
callComposite.events.onRemoteParticipantJoined = onRemoteParticipantJoinedHandler

Účastník opustil hovor.

Zveřejňujeme onRemoteParticipantLeft naslouchání, pokud účastník opustí hovor.

let onRemoteParticipantLeftHandler: ([CommunicationIdentifier]) -> Void = { [weak callComposite] ids in
            guard let composite = callComposite else {
                return
            }
            /// ids are the communication identifiers which have left the meeting just now.
        }
callComposite.events.onRemoteParticipantLeft = onRemoteParticipantLeftHandler

Další kroky