Javascript 如何通过videojs录制将正面摄像头切换到背面摄像头进行图像拍摄?
这适用于视频(将代码片段摄影机更改为背面摄影机) 但类似地,对于图像,并没有任何改变。 照相机仍然相同(仅正面照相机) 我对imagePlayer的选择是Javascript 如何通过videojs录制将正面摄像头切换到背面摄像头进行图像拍摄?,javascript,record,video.js,video-camera,videojs-record,Javascript,Record,Video.js,Video Camera,Videojs Record,这适用于视频(将代码片段摄影机更改为背面摄影机) 但类似地,对于图像,并没有任何改变。 照相机仍然相同(仅正面照相机) 我对imagePlayer的选择是 const options = { controls: true, width: width, height: height, controlBar: { volumePane
const options = {
controls: true,
width: width,
height: height,
controlBar: {
volumePanel: true
},
plugins: {
record: {
image: true,
imageOutputType: 'blob',
mandatory: {
minWidth: 1280,
minHeight: 720,
},
frameWidth: 1280,
frameHeight: 720,
}
}
};
const imagePlayer = videojs('image-frame', options);
镜框是
<video id="image-frame"></video>
很高兴有任何帮助或线索来解决相机切换问题
imagePlayer.record().recordImage = {deviceId: {exact: 'backface-camera-device-id'}};
imagePlayer.record().stopDevice();
imagePlayer.record().getDevice();
对我有效。到目前为止,您尝试了哪些方法?您是否尝试过将
video:{deviceId:{exact:deviceId}}
传递给初始值设定项,而不是随后进行设置?@milgner,我已经尝试过这两种方法,video:{deviceId:{exact:deviceId}
和image:{deviceId:{exact:deviceId}
-仍然只对视频有效,但是对于image-不起作用。@Andrii没有关于这个问题的任何更新。我也有同样的问题
<video id="image-frame"></video>
const options = {
controls: true,
width: width,
height: height,
fluid: false,
controlBar: {
volumePanel: false,
cameraButton: true,
},
plugins: {
record: {
audio: true,
video: true,
videoEngine: 'recordrtc',
maxLength: 120,
debug: true,
mandatory: {
minWidth: 1280,
minHeight: 720,
},
frameWidth: 1280,
frameHeight: 720,
timeSlice: 1000
}
}
};
imagePlayer.record().recordImage = {deviceId: {exact: 'backface-camera-device-id'}};
imagePlayer.record().stopDevice();
imagePlayer.record().getDevice();