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 278 forks source link

Edit Unity Webcam Source #810

Closed xuhaozheng closed 2 years ago

xuhaozheng commented 2 years ago

1. The original Webcam Source will only select the first camera in the list. How can we select the target camera we want in Unity? I think selecting a specific camera should be a very important and necessary function.

In UWP/Desktop it's very easy since we could edit the code as we want, but Unity the WebRTC component seems to be unable to change.

2. Can we edit the Webcam Souce to achieve that?[Can we edit WebRTC script?]

I've tried to copy the Webcam Source script totally and change the Device id as I want. The camera could work normally on Local Video Player while the modified webcam_source script cannot be recognized as a component by PeerConnection so that the video data cannot be transferred.

ChrisTJie commented 2 years ago

Has your problem been solved?

xuhaozheng commented 2 years ago

I edited the WebCom.cs to set the device id as I want.