public void initLocal(PeerConnection pc, SdpObserver sdpObserver) { mLocal = true; mState = StreamState.LOCAL; this.pc = pc; mSdpConstraints = new MediaConstraints(); mSdpConstraints.mandatory.add(new MediaConstraints.KeyValuePair( "OfferToReceiveAudio", "true")); mSdpConstraints.mandatory.add(new MediaConstraints.KeyValuePair( "OfferToReceiveVideo", "true")); pc.createOffer(sdpObserver, mSdpConstraints); }
public void initRemote(PeerConnection pc, SdpObserver sdpObserver) { mLocal = false; mState = StreamState.OPENING; this.pc = pc; mSdpConstraints = new MediaConstraints(); mSdpConstraints.mandatory.add(new MediaConstraints.KeyValuePair( "OfferToReceiveAudio", "true")); mSdpConstraints.mandatory.add(new MediaConstraints.KeyValuePair( "OfferToReceiveVideo", "true")); pc.createOffer(sdpObserver, mSdpConstraints); }