This works for video (With the code snippet camera changes to backface camera)
videoPlayer.record().stopDevice();
videoPlayer.record().setVideoInput('backface-camera-device-id');
But analogically for image doesn't change anything. Camera still the same (Only frontface camera)
imagePlayer.record().stopDevice();
imagePlayer.record().setVideoInput('backface-camera-device-id');
My options for imagePlayer is
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);
Image frame is
<video id="image-frame"></video>
My video options (works only with 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
}
}
};
Glad to any help or clue to solve the camera switching problem!