2.20 Enterprise with MediaSoup throwing error on publisher.subscribeToRemote()

I have 2x OV stacks. One 2.20 CE with KMS and one 2.20 Enterprise with MediaSoup.

Switching between the two, the CE works as expected with publisher.subscribeToRemote() but the Enterprise deployment throws this error in JS:

openvidu-browser-2.20.0.min.js:1 Uncaught (in promise) DOMException: Failed to execute ‘setRemoteDescription’ on ‘RTCPeerConnection’: Failed to set remote answer sdp: The order of m-lines in answer doesn’t match order in offer. Rejecting answer.

All good for other circumstances, but not for subscribeToRemote.

Please can you share with us browser logs and OpenVidu Server logs for failing case please?

Yes, this has a very simple explanation. Publisher.subscribeToRemote is not available in mediasoup, at least for now.

Easy answer!

Thank you.

It would be useful to have as I use subscribeToRemote for an automated self test system so that users can verify full connectivity on a page.

We have already added this method to the list of known limitations while using mediasoup.
There is a way to implement the same funcitonality, but it won’t be as simple as publishing a Publisher object after calling subscribeToRemote method.

You can make use of the same strategy currently used to publish more than one stream per client: initialize a completely different OpenVidu object, a different Session object, connect to it as a different user with a different token, and subscribe to the Publisher as a different user. But all of this from the same client. This is the strategy to, for example, publish a webcam but also screen sharing. BUt in this case, instead of two Connections publishing two Publishers, you would have two Connections, one publishing a Publihser, and the other one susbcribing to that Publisher. You just would have to take care of properly displaying the videos to mimic your current behavior with subscribeToRemote (for example, hiding the Publisher video and only presenting the Subscriber video).

Does this make sense?

That makes sense, thanks.

Is there a call in openvidu-browser to detect the current media server? (Kurento/MediaSoup)

No, there is not. You should send that information from your application’s backend.