当前位置:网站首页>Camera switching
Camera switching
2022-07-27 10:37:00 【Hide roses on your back】
button.addEventListener('click', function (ev) {
console.log(mediaDevice.deviceId)
if (typeof currentStream !== 'undefined') {
stopMediaTracks(currentStream);
}
const videoConstraints = {};
console.log(mediaDevice.deviceId )
videoConstraints.deviceId = { exact: mediaDevice.deviceId };
const constraints = {
video: videoConstraints,
audio: true
};
navigator.mediaDevices
.getUserMedia(constraints)
.then(stream => {
currentStream = stream;
video.srcObject = stream;
return navigator.mediaDevices.enumerateDevices();
})
.then(gotDevices)
.catch(error => {
console.error(error);
});
})边栏推荐
- 7z用法
- Program translation and execution, from editing, preprocessing, compilation, assembly, linking to execution
- Matlab- draw bifurcation and chaotic bifurcation diagrams
- flask_restful中的输出域(Resource、fields、marshal、marshal_with)
- 数据库操作基础语句
- The core concept and fast practice of shardingsphere
- 语音识别的一些开源项目整理
- [Linux] install redis
- samba服务器
- Hugo learning notes
猜你喜欢

How to smooth the online and offline of Web Services

Beijing publicized the spot check of 8 batches of children's shoes, and qierte was listed as unqualified

MySQL master-slave architecture, read-write separation, and high availability architecture

异构计算技术分析

【Flutter】SharedPreferences使用

Redis data structure analysis (II)

gyp ERR! configure error. gyp ERR! stack Error: gyp failed with exit code: 1
![[shutter] SharedPreferences](/img/e4/e7518126d35c9ed0eeeacabb262cd3.png)
[shutter] SharedPreferences

Data types and variables

Understanding of batchnorm2d() function in pytorch
随机推荐
阿里邮箱web端登录转圈的处理
【英雄哥六月集训】第 25天: 树状数组
Matlab底层源代码实现图像的中值滤波(用于消除图像上一些杂点)
Samba server
Different binary conversion of MATLAB
warning package. Json: no license field error
【英雄哥六月集训】第 27天: 图
Metaaploit post penetration technology knowledge
Metaspolit
Metasploit Eternal Blue attack
File upload vulnerability related
JSP自定义标签之自定义分页01
数据库操作基础语句
简单几步教您实现为工业树莓派共享网络
How to smooth the online and offline of Web Services
这种动态规划你见过吗——状态机动态规划之股票问题(上)
DES/3DES/AES区别
Share machine learning notes (PDF version) + practical projects (dataset + code)
【精选】如何完美的写 PHP 代码的呢?
Multipoint bidirectional republication and routing strategy