microsoft / MixedReality-WebRTC

MixedReality-WebRTC is a collection of components to help mixed reality app developers integrate audio and video real-time communication into their application and improve their collaborative experience
https://microsoft.github.io/MixedReality-WebRTC/
MIT License
898 stars 277 forks source link

Help with Offer Creation (UWP Tutorial) #851

Open IanMcAtee opened 2 years ago

IanMcAtee commented 2 years ago

Hi everyone,

I am looking for help with establishing the webRTC connection between a HoloLens and a UWP desktop app. I have followed the MR-WebRTC unity tutorial and have successfully connected the HoloLens to a Unity app. However, now I want to build a desktop UWP app for the HoloLens to connect to. I am attempting to follow the UWP tutorial and have gotten stuck on the last part, "establishing a Web-RTC connection". I have created a button whose on-click event "ConnectButton_Click" simply calls _peerConnection.CreateOffer() and adds the media transceivers. Unfortunately, I don't see an offer being sent on the NodeDss Signaler. I have confirmed that both the UWP app and the HoloLens are polling the signaling server and that the remote and local peer IDs are set correctly on both implementations. Moreover, the code for the transceiver creation gives me the following exception "Exception thrown: 'Microsoft.MixedReality.WebRTC.InvalidInteropNativeHandleException' in Microsoft.MixedReality.WebRTC.dll".

I am new to WebRTC and would really appreciate anyone's help in debugging these issues. I have attached my code for reference, let me know if you need anything additional information.

MainPage.pdf

Jos5565 commented 2 years ago

you can try _peerConnection.StartConnection(), on the button Event!

IanMcAtee commented 2 years ago

Thanks for the feedback. I actually solved this, it was a dumb mistake. I realized I never initialized the peer connection by calling _peerConnection.InitializeAsync(config).

As for the transceiver issue, I solved it by the method suggested in this issue: https://github.com/microsoft/MixedReality-WebRTC/issues/547