{"id":4406,"date":"2021-11-18T20:57:10","date_gmt":"2021-11-18T12:57:10","guid":{"rendered":"https:\/\/www.enablex.io\/developer\/?page_id=4406"},"modified":"2022-04-08T18:17:37","modified_gmt":"2022-04-08T10:17:37","slug":"get-devices","status":"publish","type":"page","link":"https:\/\/doc.smartflomeet.ttns.in\/developer\/video-api\/client-api\/ios-toolkit\/get-devices\/","title":{"rendered":"Get Media Devices: iOS SDK &#8211; Video API"},"content":{"rendered":"\n<ul><li><a href=\"#get-devices\">Get List of Audio Devices<\/a><\/li><li><a href=\"#get-selected-devices\">Get Selected Audio Device by User<\/a><\/li><li><a href=\"#handle-audio-device-updates\">Handle Device Updates<\/a><\/li><\/ul>\n\n\n\n<a name=\"get-devices\"><\/a>\n\n\n\n<div style=\"height:20px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<h2>Get List of Audio Devices<\/h2>\n\n\n\n<p>You can initiate a Stream&nbsp;using&nbsp;either the browser\u2019s default Audio Device or&nbsp;by&nbsp;specifying&nbsp;the ID of&nbsp;the Audio Device connected to the device running the client application which requires you to get the Device IDs of all the connected devices. &nbsp;<\/p>\n\n\n\n<p>The&nbsp;<code>EnxRoom.getDevices()<\/code>&nbsp;method provides a list of all the Microphones connected to your Device. You can also use this method to build UI Element allowing users to choose an Audio Device from the list.<\/p>\n\n\n\n<p><strong>Class<\/strong>: <code>EnxRoom<\/code><\/p>\n\n\n\n<p><strong>Method<\/strong>: <code>-(NSArray*)getDevices; <\/code><\/p>\n\n\n\n<p><strong>Returns:<\/strong> Device list<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">NSArray *devicesList = [room getDevices];\n\n\/\/ Returns [Speaker, EARPIECE, Headphones, Bluetooth] \n\/\/ Note: One or many of these devices in array as applicable<\/pre>\n\n\n\n<a name=\"get-selected-devices\"><\/a>\n\n\n\n<div style=\"height:20px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<h2>Get Selected Audio Device by User<\/h2>\n\n\n\n<p>The&nbsp;<code>EnxRoom.getSelectedDevice()<\/code>&nbsp;method provides the currently selected\/in-use Audio Device for the Stream.<\/p>\n\n\n\n<p><strong>Class<\/strong>: <code>EnxRoom<\/code><\/p>\n\n\n\n<p><strong>Method<\/strong>: <code>-(NSString*)getSelectedDevice;<\/code> <\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">String selectedDevice =  [room getSelectedDevice]; \n\/\/ Returns one of these - Speaker, EARPIECE, Headphones, Bluetooth<\/pre>\n\n\n\n<a name=\"handle-audio-device-updates\"><\/a>\n\n\n\n<div style=\"height:20px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<h2>Handle Audio Device Updates<\/h2>\n\n\n\n<p>The notification on any addition or modification in the Audio Devices such as earphones or headphones connected to the Mobile device is provided through the following Callbacks:<\/p>\n\n\n\n<p><strong>Delegate Method: <\/strong><\/p>\n\n\n\n<p><code>- (void)didNotifyDeviceUpdate:(NSString*)updates;<\/code>  &#8211; Acknowledgment to the user when a switch to alternate media devices is made at run-time.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">- (void)didNotifyDeviceUpdate:(NSString*)updates  {\n  \/\/ Device attached or detached\n}<\/pre>\n\n\n\n<div style=\"height:40px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<hr class=\"wp-block-separator is-style-wide\"\/>\n\n\n\n<div class=\"wp-block-columns\">\n<div class=\"wp-block-column\">\n<p>\u2190 <a href=\"..\/how-to-use\/\">How to use iOS SDK<\/a><\/p>\n<\/div>\n\n\n\n<div class=\"wp-block-column\">\n<p class=\"has-text-align-center\"><a href=\"..\/\">Index<\/a><\/p>\n<\/div>\n\n\n\n<div class=\"wp-block-column\">\n<p class=\"has-text-align-right\"><a href=\"..\/local-stream\/\">Create Local Stream<\/a> \u2192<a href=\"\/developer\/how-to-use\/\"><\/a><\/p>\n<\/div>\n<\/div>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Get List of Audio Devices Get Selected Audio Device by User Handle Device Updates Get List of Audio Devices You can initiate a Stream&nbsp;using&nbsp;either the browser\u2019s default Audio Device or&nbsp;by&nbsp;specifying&nbsp;the ID of&nbsp;the Audio Device connected to the device running the client application which requires you to get the Device IDs of all the connected devices. &nbsp; The&nbsp;EnxRoom.getDevices()&nbsp;method provides a list of all the Microphones connected to your Device. You can&hellip; <\/p>\n","protected":false},"author":1,"featured_media":0,"parent":3732,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"ub_ctt_via":""},"featured_image_src":null,"uagb_featured_image_src":{"full":false,"thumbnail":false,"medium":false,"medium_large":false,"large":false,"1536x1536":false,"2048x2048":false,"featured":false,"featured-large":false},"uagb_author_info":{"display_name":"vcxdevwpadmin","author_link":"https:\/\/doc.smartflomeet.ttns.in\/developer\/author\/vcxdevwpadmin\/"},"uagb_comment_info":0,"uagb_excerpt":"Get List of Audio Devices Get Selected Audio Device by User Handle Device Updates Get List of Audio Devices You can initiate a Stream&nbsp;using&nbsp;either the browser\u2019s default Audio Device or&nbsp;by&nbsp;specifying&nbsp;the ID of&nbsp;the Audio Device connected to the device running the client application which requires you to get the Device IDs of all the connected devices.&hellip;","_links":{"self":[{"href":"https:\/\/doc.smartflomeet.ttns.in\/developer\/wp-json\/wp\/v2\/pages\/4406"}],"collection":[{"href":"https:\/\/doc.smartflomeet.ttns.in\/developer\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/doc.smartflomeet.ttns.in\/developer\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/doc.smartflomeet.ttns.in\/developer\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/doc.smartflomeet.ttns.in\/developer\/wp-json\/wp\/v2\/comments?post=4406"}],"version-history":[{"count":0,"href":"https:\/\/doc.smartflomeet.ttns.in\/developer\/wp-json\/wp\/v2\/pages\/4406\/revisions"}],"up":[{"embeddable":true,"href":"https:\/\/doc.smartflomeet.ttns.in\/developer\/wp-json\/wp\/v2\/pages\/3732"}],"wp:attachment":[{"href":"https:\/\/doc.smartflomeet.ttns.in\/developer\/wp-json\/wp\/v2\/media?parent=4406"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}