mirror of
https://github.com/nextcloud/talk-android
synced 2025-06-20 03:59:35 +01:00
Keep track of the stream in the peer connection
Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
This commit is contained in:
parent
18f21c4f48
commit
4aef76e347
@ -121,6 +121,9 @@ public class PeerConnectionWrapper {
|
||||
private final boolean isMCUPublisher;
|
||||
private final String videoStreamType;
|
||||
|
||||
// It is assumed that there will be at most one remote stream at each time.
|
||||
private MediaStream stream;
|
||||
|
||||
@Inject
|
||||
Context context;
|
||||
|
||||
@ -219,6 +222,10 @@ public class PeerConnectionWrapper {
|
||||
return videoStreamType;
|
||||
}
|
||||
|
||||
public MediaStream getStream() {
|
||||
return stream;
|
||||
}
|
||||
|
||||
public void removePeerConnection() {
|
||||
signalingMessageReceiver.removeListener(webRtcMessageListener);
|
||||
|
||||
@ -484,11 +491,15 @@ public class PeerConnectionWrapper {
|
||||
|
||||
@Override
|
||||
public void onAddStream(MediaStream mediaStream) {
|
||||
stream = mediaStream;
|
||||
|
||||
peerConnectionNotifier.notifyStreamAdded(mediaStream);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onRemoveStream(MediaStream mediaStream) {
|
||||
stream = null;
|
||||
|
||||
peerConnectionNotifier.notifyStreamRemoved(mediaStream);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user