Open Licege opened 2 years ago
Hey @Licege. Thanks for the report!
Can you post a minimal working example of this? I would like to reproduce this.
Also, please add:
Hello, I added simple example here https://github.com/Licege/peerjs-bug
Browser: Chrome (100.0.4896.127); OS: Mac OS Big Sur 11.6 (but try also Windows 10); PeerJS: 1.3.2; Yes we use webpack)
@Licege I have faced with this bug i fixed it by this code:
static createBlankVideoTrack(opts = {}) {
const { width = 1920, height = 1080 } = opts
const canvas = Object.assign(document.createElement("canvas"), {
width,
height,
})
canvas.getContext("2d").fillRect(0, 0, width, height)
const stream = canvas.captureStream()
return stream
}
...
const audioTrack = stream.getAudioTracks()[0]
const videoStream = UserMedia.createBlankVideoTrack()
videoStream.addTrack(audioTrack)
stream = videoStream
just create blank video track and add an audio track from the main stream
Hello, I have a some problem with video tracks. If user doesn't have a webcam or deny permission in browser than he don't receive video tracks from another users (which send video). I can fix it only if I change options which passed in offer like that: