Closed AriHrannar closed 2 years ago
In their developer doc, it states setVideoSource will not work "If the publisher does not currently use a camera input, the promise will reject with an error with the name property set to 'OT_SET_VIDEO_SOURCE_FAILURE'." I agree this is definitely something we need so we can change videoSource once the publisher is started. My workaround is to use "backgroundEffectProcessor.setInputStream(mediaStream);" to change the stream to the other camera.
Yes, using the backgroundEffectProcessor.setInputStream(mediaStream);
is the right approach
Hi,
When I initialise the publisher I am setting the
videoSource
aseffectProcessor.outputStream.getVideoTracks()[0]
as per the documentation.Then we have another feature where you can change your camera from f.x. the internal laptop one to an external camera. Here we use OT.getDevices and get a list of devices, we then filter by
kind
forvideoInput
and then we have a list of video inputs. Then each video input has adeviceId
, which we then send to publisher.setVideoSource to change the camera.However, when I call
publisher.setVideoSource
with a device id, the video source is not changed.Here you can see the code where I am logging the device id and then the result of
getVideoSource
before and aftersetVideoSource
is calledHere you can see the result, the video source is unchanged. The
deviceId
is also null here, perhaps that is part of the problem, I would expect this to be the id of the video source device where the background is being changed :)Im running "@opentok/client": "2.22.2" "@vonage/video-effects": "1.0.0-rc3",
I hope that is clear enough, let me know if something is unclear :)