Trying to implement shared screen with OV. Currently, I have something like this for the user’s camera:
let OV = new OpenVidu();
let session = OV.initSession();
let publisher = OV.initPublisher("layout", {
mirror: true,
});
session.on('streamCreated', event => {
session.subscribe(event.stream, "layout");
});
And for screen sharing I have:
ScreenSharer = new OpenVidu();
screensession = ScreenSharer.initSession();
skreen = ScreenSharer.initPublisher("screendiv", {
videoSource: "screen",
publishAudio: false,
});
skreen.once('accessAllowed', () => {
screensession.publish(skreen);
});
What I expect is that the shared screen is shown inside the “screendiv” div, instead it shows inside the “layout” div. How do I fix this?
Is this the best way to have a camera and a screen in the same session?