We are looking for a solution for adding a video source without interrupting audio transmission.
The goal is to write an application which only asks for permissions when they are needed, i.e. not to ask for video permission on joining the session. It should only be asked for once the video stream gets enabled by the user afterwards.
What we do at the moment is the following:
1.) The user joins the session and a new publisher transmitting only an audio stream is created:
var publisher = OV.initPublisher('videos', { audioSource: undefined, videoSource: null, publishAudio: true, publishVideo: false, insertMode: 'PREPEND' });
2.) The user presses the button for enabling his video stream:
`
var newPublisher = OV.initPublisher(‘videos’, {
audioSource: undefined,
videoSource: undefined,
publishAudio: true,
publishVideo: true,
resolution: ‘640x480’,
frameRate: 30,
insertMode: ‘PREPEND’,
mirror: true
});
newPublisher.on(‘videoElementCreated’, function (event) {
$(event.element).prop(‘muted’, true);
});
// unpublish the old publisher
session.unpublish(publisher);
// publish the new publisher
publisher = newPublisher;
session.publish(publisher);
`
The problem with this is that by unpublishing the stream, the audio stream gets interrupted for a few seconds. However, we don’t see another way for:
1.) Asking for video permission at a later time, and
2.) Adding a video stream to the existing audio stream
We’ve been looking for some kind of “dummy video device” which we can include in the initial publisher’s stream in order to replace it with the real stream afterwards - but we couldn’t find a way to get this working.
Is there any way to solve our issue so that the audio transmission doesn’t get interrupted?