Thank you for quick response, i've seen that post before and I have already updated Janus to this version, but now i found that this delay was caused by stopping track in prepareWebRTC function:
if(media.removeVideo || media.replaceVideo) {
if(config.myStream && config.myStream.getVideoTracks() && config.myStream.getVideoTracks().length) {
var vt = config.myStream.getVideoTracks()[0];
Janus.log("Removing video track:", vt);
config.myStream.removeTrack(vt);
try {
//vt.stop();
} catch(e) {}
},
I've commented out line responsible for stopping a track and there isn't any delay now, but it caused another problem, because camera LED is still on, even after turning it off.