private static final String TAG = "AppRTCDemoActivity";
private PeerConnectionFactory factory;
private VideoSource videoSource;
+ private boolean videoSourceStopped;
private PeerConnection pc;
private final PCObserver pcObserver = new PCObserver();
private final SDPObserver sdpObserver = new SDPObserver();
vsv.onPause();
if (videoSource != null) {
videoSource.stop();
+ videoSourceStopped = true;
}
}
public void onResume() {
super.onResume();
vsv.onResume();
- if (videoSource != null) {
+ if (videoSource != null && videoSourceStopped) {
videoSource.restart();
}
}
vsv, VideoStreamsView.Endpoint.LOCAL)));
lMS.addTrack(videoTrack);
}
- lMS.addTrack(factory.createAudioTrack("ARDAMSa0"));
+ if (appRtcClient.audioConstraints() != null) {
+ lMS.addTrack(factory.createAudioTrack(
+ "ARDAMSa0",
+ factory.createAudioSource(appRtcClient.audioConstraints())));
+ }
pc.addStream(lMS, new MediaConstraints());
}
logAndToast("Waiting for ICE candidates...");