ThinkChat🤖让你学习和工作更高效,注册即送10W Token,即刻开启你的AI之旅 广告
[TOC] ## 视频约束 约束详解 * widht * height * aspectRatio(长宽比) * frameRate(帧率) * facingMode * * user :前置摄像头 * * environment :后置摄像头 * * left :前置左侧摄像头 * * right :前置右侧摄像头 约束实现详解 ``` var constraints = { video: { width: 640, height: 480, frameRate: 30, facingMode: 'user' }, audio: false } navigator.mediaDevices.getUserMedia(constraints) .then(gotMediaStream) .then(gotDevices) .catch(handleGetMediaError); ``` ## 音频约束 约束详解 * volume(音量,0-1.0) * sampleRate(采样率) * sampleSize(样本含量) * echoCancellation(回声消除) * autoGainControl(自动增益控制) * noiseSuppression(降噪) * latency(延迟) * channelCount(单双声道) * deviceID(设备id) * groupID