VLprojects / mediasoup-client-swift

Swift wrapper for libmediasoupclient
MIT License
42 stars 17 forks source link

getting error while creating producer #4

Open satishjkoladiya opened 1 year ago

satishjkoladiya commented 1 year ago

Unexpected error: unknown(Error Domain=MediasoupClientErrorDomain Code=3 "The associated promise has been destructed prior to the associated state becoming ready." UserInfo={NSLocalizedDescription=The associated promise has been destructed prior to the associated state becoming ready.}).

fedulvtubudul commented 1 year ago

Most probably it's one of the next:

  1. Calling createProducer(...) from arbitrary thread (you must make all calls to Device / Transports / Producers / Consumers from the same dedicated thread / serial queue)

  2. onProduce method implemented incorrectly. This method MUST call it's callback either with nil parameter in case of an error, or with producer id value provided by your media server via signaling mechanism. In this case you must hold the callback until signaling is finished and call the callback on main thread passing producerId provided by your media server.