windowscamerawebrtc

Is there a fixed order to the list of devices retrieved with the WebRTC's enumerateDevice API?


I am using windows laptop with chrome browser.

Whenever I am using webpages using WebRTCs,(e.g. WebRTC Sample) when I'm choosing which camera to use, It shows list of cameras with same order.

I thought the list would change if I choose different cameras, but It seems like the list itself does not change.

How does WebRTC get it's list from? Can I change it's order? (e.g. by modifying my PC's registries, etc)


Solution

  • The enumerateDevices API gives you a list of devices that are available, how you present them is up to you. A common approach is to store the previously selected deviceId and present it as first choice with a custom sorting.