StreamOptions streamOptions = new StreamOptions(streamName);
Constraints constraints = getConstraints();
streamOptions.setConstraints(constraints);
...
publishStream = session.createStream(streamOptions);
...
@NonNull
private Constraints getConstraints() {
AudioConstraints audioConstraints = null;
if (mSendAudio.isChecked()) {
audioConstraints = new AudioConstraints();
...
}
VideoConstraints videoConstraints = null;
if (mSendVideo.isChecked()) {
videoConstraints = new VideoConstraints();
...
}
return new Constraints(audioConstraints, videoConstraints);
}