use of org.webrtc.MediaStream in project actor-platform by actorapp.
the class AndroidPeerConnection method close.
@Override
public void close() {
AndroidWebRTCRuntimeProvider.postToHandler(() -> {
while (!ownStreams.isEmpty()) {
CountedReference<WebRTCMediaStream> stream = ownStreams.remove(0);
peerConnection.removeStream(((AndroidMediaStream) stream.get()).getStream());
stream.release();
}
for (MediaStream stream : streams.keySet()) {
AndroidMediaStream stream1 = streams.get(stream);
if (stream1 != null) {
for (WebRTCPeerConnectionCallback c : callbacks) {
c.onStreamRemoved(stream1);
}
}
}
peerConnection.dispose();
});
}
Aggregations