nextrtc-example-videochat icon indicating copy to clipboard operation
nextrtc-example-videochat copied to clipboard

video number is Incorrect

Open lishidetainan opened this issue 5 years ago • 1 comments

when I open more than four web client, I join the same conversation, the last client show the video number more than four.

lishidetainan avatar Jan 08 '19 06:01 lishidetainan

hi i think i found the issue; beacuse of this line in nextrtc.js remoteConnection.ontrack = e => this.onRemoteStream(connectionName, e.streams); the ontrack event handler fires twice, if the remotestream has both audio and video (so i assume that you changed the audio:false to audio:true :) just like me )

but as the orijinal git example has audio: false i think msolarez has missed this situation. so i think thats the problem but how to resolve this?

Maybe this could be;

		nextRTC.on('remoteStream', function (stream) {
		
		var dest = $('#'+stream.member);
		if(dest.length==0 ) {
			  dest = $("#template").clone().addClass('remotestream').prop({id: stream.member});
			  $("#container").append(dest);
			  dest[0].srcObject = stream.stream;
		} else {
			  dest[0].srcObject = stream.stream;
		}
			
			
		});

emreokutan avatar Feb 08 '19 12:02 emreokutan