0

I know how to create a send-only offer by add "OfferToReceiveVideo:false" and "OfferToReceiveAudio:false" in param MediaConstraints in this method:

public void createOffer(SdpObserver observer, MediaConstraints constraints)

But how can I create a receive-only sdp offer? I try to create it by adding no media stream to peer connection, however, it will cause sdp very short and no line "a:recvonly" contains. And no ice candidate generated.

I want to create a webrtc peer connection to receive media stream, but not send.

Phantômaxx
  • 37,901
  • 21
  • 84
  • 115
Shensheng Kuang
  • 458
  • 1
  • 5
  • 10

1 Answers1

1

Solved. Set "OfferToReceiveAudio" and "OfferToReceiveVideo" to "true" in MediaConstraints. And do not add stream.

Shensheng Kuang
  • 458
  • 1
  • 5
  • 10