/** * 检查设备是否支持 */ // import Common from './common'; import { message } from "antd"; // const presetting = new Presetting(); // presetting.init(); export default function CheckRTC(){ // 检查浏览器是否支持TRTC视频功能(check if browser is compatible with TRTC) TRTC.checkSystemRequirements().then(result => { console.log("检测浏览器") if (!result) { alert('您的浏览器不兼容视频应用!建议下载最新版Chrome浏览器'); window.location.href = 'http://www.google.cn/chrome/'; } }); // setup logging stuffs TRTC.Logger.setLogLevel(TRTC.Logger.LogLevel.DEBUG); TRTC.Logger.enableUploadLog(); TRTC.getDevices() .then(devices => { devices.forEach(item => { console.log('device: ' + item.kind + ' ' + item.label + ' ' + item.deviceId); }); }) .catch(error => {message.error("获取设备失败");console.error('getDevices error observed ' + error)}); // populate camera options // TRTC.getCameras().then(devices => { // devices.forEach(device => { // console.log(device) // if (!Common.cameraId) { // Common.cameraId = device.deviceId; // } // // let div = $('
'); // // div.attr('id', device.deviceId); // // div.html(device.label); // // div.appendTo('#camera-option'); // }); // }); // populate microphone options // TRTC.getMicrophones().then(devices => { // devices.forEach(device => { // if (!Common.micId) { // Common.micId = device.deviceId; // } // // let div = $('
'); // // div.attr('id', device.deviceId); // // div.html(device.label); // // div.appendTo('#mic-option'); // }); // }); }