getMediaDevices (Obtaining the Device List)
Interface Description
This interface is invoked to obtain the local device list, such as the microphone and speaker.
Notes
This interface can be invoked only after an account is successfully registered.
Method Definition
OpenEyeCall.prototype.getMediaDevices = function(type, callbacks)
Parameter Description
Parameter |
Type |
Mandatory/Optional |
Description |
---|---|---|---|
type |
Number |
Mandatory |
Device type. The value 0 indicates a microphone, and the value 1 indicates a speaker. |
callbacks |
Optional |
Callback method. |
Parameter |
Type |
Mandatory/Optional |
Description |
---|---|---|---|
response |
function |
Mandatory |
For details about the input parameters of the callback method, see Table 3. |
Parameter |
Type |
Description |
---|---|---|
description |
String |
Description of the current request. |
result |
Number |
Query result. The value 0 indicates success and other values indicate failure. |
rsp |
Number |
Internal message ID. |
param |
Device information. |
Parameter |
Type |
Description |
---|---|---|
array |
Device (Table 5) array |
Device list. |
device_num |
Number |
Number of devices. |
Parameter |
Type |
Description |
---|---|---|
camera_orient |
Number |
Reserved field. |
index |
Number |
Serial number of a device. |
name |
String |
Device name. |
{ "description" : "tsdk_get_devices", "param" : { "deviceInfo" : [ { "cameraOrient":0, "deviceId":0, "deviceName": "default: Speaker (Huawei HDP Audio Driver)", "index":0 }, { "cameraOrient":0, "deviceId":0, "deviceName":"Speaker (Huawei HDP Audio Driver)" "index":1 } ], "deviceType": 1, "num" : 2 }, "result" : 0, "rsp" : 67550 }
Examples
function getMediaDevices() { global_openEye_SDK.openEyeCall.getMediaDevices(1, { response: getMediaDevicesResponse }); } function getMediaDevicesResponse(data) { console.info(data); if (data.result == 0) { console.info("GetMediaDevices success"); } else { console.error("GetMediaDevices failed"); } }
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot