通过navigator.mediaDevices.getUserMedia获取摄像头,设置了视频宽高不生效。
navigator.mediaDevices.getUserMedia({audio: true, video: {
width: 100,
height: 200
}}).then(stream => {
self.localVideo.srcObject = stream;
self.localStream = stream;
}).catch(err => {
console.error(err);
});
|
|