====== onSources() ====== wrtc.onSources() is called when [[ixnx:wrtc:js:api:sources_array|list of available local audio and video sources]] has been populated. wrtc.onSources() occur only in Chrome and Safari browsers. If other browser is used wrtc.onSources() never occur. You can use this event function to call [[ixnx:wrtc:js:api:wrtc:get|wrtc.get("audioSources")]] and [[ixnx:wrtc:js:api:wrtc:get|wrtc.get("videoSources")]] and allow user select which camera and microphone to use. ===== Occurs ===== List of audio and video sources has been populated. As the Chrome browser takes a while to populate the sources lists they cannot be accessed right away after page has been loaded. Do not attempt to [[ixnx:wrtc:js:api:wrtc:get|wrtc.get()]] the lists in [[ixnx:wrtc:js:api:wrtc:init|wrtc.init()]]. Once Chrome has finished preparing the lists wrtc.onSources() will occur indicating you are welcome to access the lists using [[ixnx:wrtc:js:api:wrtc:get|wrtc.get()]] ===== Arguments ===== wrtc.onSources() * None ===== Example ===== Fill User can later select microphone from list of available ones in dropdown asource, set [[ixnx:wrtc:js:api:wrtc:audiosource|wrtc.audioSource]] to selected dropdown value and call [[ixnx:wrtc:js:api:wrtc:changemedia|wrtc.changeMedia()]]. And the same for video. ===== See Also ===== [[ixnx:wrtc:js:api:wrtc:get|wrtc.get("audioSources")]], [[ixnx:wrtc:js:api:wrtc:get|wrtc.get("audioDestinations")]] and [[ixnx:wrtc:js:api:wrtc:get|wrtc.get("videoSources")]] [[ixnx:wrtc:js:api:wrtc:audiosource|wrtc.audioSource]], [[ixnx:wrtc:js:api:wrtc:audiodestination|wrtc.audioDestination]] and [[ixnx:wrtc:js:api:wrtc:videosource|wrtc.videoSource]]