I'm using JavaRTC to create a simple server that is connected to by web page clients.
In essence, each web page creates an RTC Peer Connection and connects to the Java-RTC app, exchanging SDPs and IceCandidates using a web socket.
The JavaRTC app connects successfully to both web page clients, verified by sending messages through the data channel.
Each web client is using one track of media - a video stream.
Within the JavaRTC I'm attempting to connect the inbound video stream of one PeerConnection with the outbound of the other.
In the web page it should trigger a track event, or renegotiation, but neither happens
These code snippets are pretty simplistic, but they demonstrate what I'm trying to do.
Java RTC
public void watch(RTCPeerConnection peerConnection, RTCPeerConnection connectionToWatch) {
final int receivers = connectionToWatch.getReceivers().length;
if (receivers == 0) return;
for (int index = 0; index < receivers; index++) {
final RTCRtpReceiver receiver = connectionToWatch.getReceivers()[index];
if (receiver != null) {
final MediaStreamTrack track = receiver.getTrack();
if (track != null) {
System.out.printf("Adding track: %s\n", track.getKind());
List<String> streamIds = new ArrayList<String>();
streamIds.add("0");
@SuppressWarnings("unused")
RTCRtpSender sender = peerConnection.addTrack(track, streamIds);
}
}
}
}
I'm using JavaRTC to create a simple server that is connected to by web page clients. In essence, each web page creates an RTC Peer Connection and connects to the Java-RTC app, exchanging SDPs and IceCandidates using a web socket.
The JavaRTC app connects successfully to both web page clients, verified by sending messages through the data channel.
Each web client is using one track of media - a video stream.
Within the JavaRTC I'm attempting to connect the inbound video stream of one PeerConnection with the outbound of the other.
In the web page it should trigger a track event, or renegotiation, but neither happens
These code snippets are pretty simplistic, but they demonstrate what I'm trying to do.
Java RTC
Web page:
Am I doing something wrong?