0

Usually when I change track in Jitsi I call conference.replaceTrack() or conference.addTrack().

When screensharing I have some effect that draws on a canvas the camera and the desktop feed. My problem currently is that after stopping screenshare I have some big delay on which the camera of the user gets added back again. I simply remove the desktopTrack and add the videoTrack back to the conference. I think is normal due to us removing the screenshare track and then adding the new one and thus making a new connection which takes time.

A solution I was thinking of is :

  • Create a track with some effect that we are going to send just once when we join the conference. This track would have an effect that draws on the canvas.
  • When we want to change the camera of the user we will call something like effect.updateVideo(videoTrack)
  • When we want to start screensharing we will call something like effect.startSreenshare(desktopTrack)
  • When we want to stop screensharing we will call something like effect.startVideo(videoTrack)

This way Im not calling replaceTrack or addTrack in order to change camera/share screen but just draw them on the already existing one.

My current problem that I am facing is that I struggle to create a track that is "clean". I'm trying to create a track that is somehow not related to a real device but I cant find a good way to do it. Aside from that I am also wondering if this solution would even work and if it is even possible to implement.

0 Answers0