I have an Array of ArrayBuffers that I send through WebRTC from peerA to peerB. The major inconvenience that I'm experiencing is this: if peerA changes the tab to another one, then he is sending at a horribly slow rate. When peerA comes back to the app's tab, the sending speed hops back to normal levels.
Is there any way to address this particular problem?
I had a similar issue when I was slicing the files, that a change of tabs dropped the rate, and overcame this by using WebWorkers. As long as I have searched the WebRTC methods are not accessible from WebWorkers (just many people asking for this feature).
Any ideas?
There's a demo page at https://webrtc.github.io/samples/src/content/datachannel/datatransfer/ that will generate and transfer data. I'm unable to see any issue like the one you describe when I put the tab in the background. If this problem persists, please file a bug at https://bugs.webrtc.org.
I believe this may be a problem with the system timer resolution. Chrome sets this to 1 ms for certain active tabs, and sets it back to a higher value for backgrounded tabs to preserve battery life. To test this, try switching to a tab that is playing a YouTube video, and see if the send speed drops in the meantime.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With