mirror of
https://github.com/nextcloud/talk-android
synced 2025-06-20 12:09:45 +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 boolean isMCUPublisher;
|
||||||
private final String videoStreamType;
|
private final String videoStreamType;
|
||||||
|
|
||||||
|
// It is assumed that there will be at most one remote stream at each time.
|
||||||
|
private MediaStream stream;
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
Context context;
|
Context context;
|
||||||
|
|
||||||
@ -219,6 +222,10 @@ public class PeerConnectionWrapper {
|
|||||||
return videoStreamType;
|
return videoStreamType;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public MediaStream getStream() {
|
||||||
|
return stream;
|
||||||
|
}
|
||||||
|
|
||||||
public void removePeerConnection() {
|
public void removePeerConnection() {
|
||||||
signalingMessageReceiver.removeListener(webRtcMessageListener);
|
signalingMessageReceiver.removeListener(webRtcMessageListener);
|
||||||
|
|
||||||
@ -484,11 +491,15 @@ public class PeerConnectionWrapper {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onAddStream(MediaStream mediaStream) {
|
public void onAddStream(MediaStream mediaStream) {
|
||||||
|
stream = mediaStream;
|
||||||
|
|
||||||
peerConnectionNotifier.notifyStreamAdded(mediaStream);
|
peerConnectionNotifier.notifyStreamAdded(mediaStream);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onRemoveStream(MediaStream mediaStream) {
|
public void onRemoveStream(MediaStream mediaStream) {
|
||||||
|
stream = null;
|
||||||
|
|
||||||
peerConnectionNotifier.notifyStreamRemoved(mediaStream);
|
peerConnectionNotifier.notifyStreamRemoved(mediaStream);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user