当前位置:网站首页>摄像头切换
摄像头切换
2022-07-17 04:55:00 【背藏玫瑰】
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);
});
})边栏推荐
猜你喜欢
随机推荐
物业小区高校水电抄表充值管理系统
Swift 【Class】【struct】
对于每一个 Provider 实例都会维护多个连接
JS中Class类的静态属性和静态方法
DNS原理及解析过程
Minio installation, deployment and use
策略模式代替if-else
Eureka,拿捏日千万级访问量妥妥的!
Water and electricity meter reading and recharge management system in Colleges and universities in property community
使用小丸工具箱进行极限视频压缩
How to configure binlog
MySql 一行变多行(根据特定符号分割)
Autojs learning-2048 small game automation
常用postgresql数据操作备忘(不定时更新)
【TA-霜狼_may-《百人计划》】基础渲染光照介绍(一)
‘ionic‘ 不是内部或外部命令,也不是可运行的程序或批处理文件。
探索:制药厂系统网络时钟同步(NTP时间同步服务器)
数据分析报告这样写,才算真正读懂了数据
PHP array_filter去空保留0,false
Phthon3 install mysqldb error problem solving reason: image not found









