====== videoSources, audioSources, audioDestinations ====== [[ixnx:wrtc:js:api:wrtc:get|wrtc.get("videoSources")]], [[ixnx:wrtc:js:api:wrtc:get|wrtc.get("audioSources")]] and [[ixnx:wrtc:js:api:wrtc:get|wrtc.get("audioDestinations")]] return a list of video sources (cams), local audio sources (mics) and local audio destinations (speakers) available. The arrays contain [[https://w3c.github.io/mediacapture-main/#device-info|MediaDeviceInfo]] objects, one for each available device. Property //label// of each object contains a descriptive name of the media device, eg "External USB Webcam" Property //deviceId// of each object contains the unique ID for that media device that you need to set [[ixnx:wrtc:js:api:wrtc:audiosource|wrtc.audioSource]], [[ixnx:wrtc:js:api:wrtc:audiodestination|wrtc.audioDestination]] or [[ixnx:wrtc:js:api:wrtc:videosource|wrtc.videoSource]] to to select that audio or video device. Only available in Chrome and Safari If attempted to [[ixnx:wrtc:js:api:wrtc:get|wrtc.get()]] the lists on other browsers the lists will be empty. If attempted to [[ixnx:wrtc:js:api:wrtc:get|wrtc.get()]] the lists before [[ixnx:wrtc:js:api:wrtc:onsources|wrtc.onSources()]] occurred the lists will be empty. ===== Events ===== Event function [[ixnx:wrtc:js:api:wrtc:onsources|wrtc.onSources()]] is called when the lists of devices are available (usually within a second after page load). If attempted to [[ixnx:wrtc:js:api:wrtc:get|wrtc.get()]] the lists before that they will be empty. ===== Example ===== ''**wrtc.get("audioSources")**\\ [0]:\\ deviceId: "23ddd3ce6002d19d969aca83d879b86427180cad082db609cf55d6b64cc495b0"\\ groupId: "ddff0f646a3bc4572e80e2f72e9285486535cdb2a1b90169215cdfecd35c2658"\\ id: "23ddd3ce6002d19d969aca83d879b86427180cad082db609cf55d6b64cc495b0"\\ kind: "audioinput"\\ label: "Dock Mik (IDT High Definition Audio CODEC)"\\ [1]:\\ deviceId: "f84adfce6f126cc2926f0098c2e27441a6ab65c4a4e8ff49d73e72872d2131f0"\\ groupId: "56772ebfd198d2abcc0d565975232d640c18110e51b6a8c2d28ad4652e10b40c"\\ id: "f84adfce6f126cc2926f0098c2e27441a6ab65c4a4e8ff49d73e72872d2131f0"\\ kind: "audioinput"\\ label: "Linje (Apowersoft_AudioDevice)"\\ [2]:\\ deviceId: "a0393cdbb3f794328b21d03386b7ba503d1fa6239c71b320084ee2b4954e9da6"\\ groupId: "ddff0f646a3bc4572e80e2f72e9285486535cdb2a1b90169215cdfecd35c2658"\\ id: "a0393cdbb3f794328b21d03386b7ba503d1fa6239c71b320084ee2b4954e9da6"\\ kind: "audioinput"\\ label: "IngÄng Mik (IDT High Definition Audio CODEC)"''