We are binding a canvas stream(media track obtained through a canvas stream) to a client side producer and transmit that track to the mediasoup mediaserver.
When the user switches to another browser tab the Server logs RTP inactivity and video is frozen to the other recipients…
However if another user generates audio simultaneously (for example a third user sends audio stream) the canvas stream resumes itself automagically even if it is still in a background browser tab.
IMO the create consumer triggered on the server is the reason why canvas stream resumes itself.
How can we explain this?
thanks in advance
Please check the link below.This issue blocks various video manipulations.
This is expected, the canvas stops painting because browser stops the activity on requestAnimationFrame I think to save resources as it is not wisely to do that much processing in background.
To fix that what I did was I used setInterval instead of requestAnimationFrame and it worked without any issue. There are other solution like using webworker but I think setInterval is good to go.
As per I know this should not be happening, but if it is true then this is amazing thing to know. You may be doing something when you receive the third audio stream you are talking about, which causes browser to understand that some activity is going on, on the tab causing canvas to resume painting.