on-internet
← Community

WebRTC Uncaught InvalidStateError: Failed to execute 'send' on 'RTCDataChannel' without 0.5s sleep

Stack Overflow ·

I have developed a minimal working test page for the WebRTC API, see WebRTC_test.html and associated js files. The problem is that it depends on a 0.5 second sleep on datachannel.js line 20. When commented it out, I received error Uncaught InvalidStateError: Failed to execute 'send' on 'RTCDataChannel': RTCDataChannel.readyState is not 'open' at datachannel.js:21:1 Can anyone see why? WebRTC_test.html: <!doctype html> <html> <head> <meta charset="utf-8" /> <meta name="viewport" content="width=device-width, initial-scale=1" /> <title>WebRTC test</title> <script type="module" src="datachannel.js

Comments

Sign in or sign up to comment and upvote.

No comments yet.