getUserMedia – camera vertical stream

I have a problem with streaming from the camera in app. I used webrtc and simple-peer in the project. Project work well but when I would use a camera (Logitech streamcam) as a vertical cam, the stream has black bars on the left and right side. Ultimately app has to work on 2 devices:
1 – vertical screen with a horizontal stream
2 – horizontal screen with a vertical stream
Some ideas, how to get a vertical stream without black bars?
When I use the front camera from the phone work perfectly…

/**
 * UserMedia constraints
 */
let constraints = {
    audio: true,
    video: true,
}
/////////////////////////////////////////////////////////

constraints.video.facingMode = {
    ideal: "user"
}

// enabling the camera at startup
navigator.mediaDevices.getUserMedia(constraints).then(stream => {

    localVideo.srcObject = stream;
    localStream = stream;

    init()

}).catch(e => alert(`getusermedia error ${e.name}`))