mirror of
https://github.com/nextcloud/talk-android
synced 2025-07-23 20:55:02 +01:00
Data channel messages are expected to be sent only to peer connections with "video" type, which provide the audio and video tracks of the participant (and, in fact, peer connections for screen shares do not even have data channels enabled in the WebUI). Note that this could change if at some point several audio/video tracks are sent in the same peer connection, or if "speaking" messages are added to screen shares, but that will be addressed if/when that happens. Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
31 lines
954 B
Java
31 lines
954 B
Java
/*
|
|
* Nextcloud Talk - Android Client
|
|
*
|
|
* SPDX-FileCopyrightText: 2024 Daniel Calviño Sánchez <danxuliu@gmail.com>
|
|
* SPDX-License-Identifier: GPL-3.0-or-later
|
|
*/
|
|
package com.nextcloud.talk.call;
|
|
|
|
import com.nextcloud.talk.models.json.signaling.DataChannelMessage;
|
|
import com.nextcloud.talk.webrtc.PeerConnectionWrapper;
|
|
|
|
import java.util.List;
|
|
|
|
/**
|
|
* Helper class to send messages to participants in a call when an MCU is not used.
|
|
*/
|
|
public class MessageSenderNoMcu extends MessageSender {
|
|
|
|
public MessageSenderNoMcu(List<PeerConnectionWrapper> peerConnectionWrappers) {
|
|
super(peerConnectionWrappers);
|
|
}
|
|
|
|
public void sendToAll(DataChannelMessage dataChannelMessage) {
|
|
for (PeerConnectionWrapper peerConnectionWrapper: peerConnectionWrappers) {
|
|
if ("video".equals(peerConnectionWrapper.getVideoStreamType())){
|
|
peerConnectionWrapper.send(dataChannelMessage);
|
|
}
|
|
}
|
|
}
|
|
}
|