Search in sources :

Example 1 with MediaStream

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();
    });
}
Also used : WebRTCPeerConnectionCallback(im.actor.runtime.webrtc.WebRTCPeerConnectionCallback) MediaStream(org.webrtc.MediaStream) WebRTCMediaStream(im.actor.runtime.webrtc.WebRTCMediaStream) WebRTCMediaStream(im.actor.runtime.webrtc.WebRTCMediaStream)

Aggregations

WebRTCMediaStream (im.actor.runtime.webrtc.WebRTCMediaStream)1 WebRTCPeerConnectionCallback (im.actor.runtime.webrtc.WebRTCPeerConnectionCallback)1 MediaStream (org.webrtc.MediaStream)1