更新时间:2024-08-22 GMT+08:00
getMediaDevices(获取设备列表)
接口描述
获取本地设备列表,如麦克风和扬声器。
注意事项
需要账号注册成功后才能调用该接口。
方法定义
OpenEyeCall.prototype.getMediaDevices = function(type, callbacks)
参数描述
参数名 | 类型 | 可选/必选 | 描述 |
|---|---|---|---|
type | Number | 必选 | 设备类型。0表示麦克风,1表示扬声器。 |
callbacks | 可选 | 回调方法。 |

回调方法的入参示例:
{
"description" : "tsdk_get_devices",
"param" : {
"deviceInfo" : [
{
"cameraOrient":0,
"deviceId":0,
"deviceName":
"default: 扬声器 (Huawei HDP Audio Driver)",
"index":0
},
{
"cameraOrient":0,
"deviceId":0,
"deviceName":"扬声器 (Huawei HDP Audio Driver)",
"index":1
}
],
"deviceType":1,
"num" : 2
},
"result" : 0,
"rsp" : 67550
} 使用示例
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");
}
} 父主题:设备管理

