amazon-kinesis-video-streams-webrtc-sdk-js
amazon-kinesis-video-streams-webrtc-sdk-js copied to clipboard
Support ICE restart and signaling reconnect in samples
Issue #, if available:
What has changed?
- Included ICE restart and SDP exchange in case of signaling disconnects.
Why was it changed?
- To advertise ICE restart in samples and include support for signals application could use to allow SDP negotiation post a signaling close event (network disruption/network change)
How was it changed?
- Included a new option in the test page to allow for ICE restart in case a disconnection or ICE agent failure is detected. The ICE restart is tried 3 times with the frequency controlled by messageTtl. In case of failure, we do not retry again. The option is not enabled by default and is controlled via a checkbox in the test page.
- Included a new option in the test page to allow for signaling reconnect in case the WS closes. SDP exchange post signaling reconnect is tried 3 times the frequency of which is controlled by messageTtl. The option is not enabled by default and is controlled via a checkbox in the test page.
- The WS reconnect attempt is configurable by the application. the default is set to 3. If WS reconnection succeeds, the signaling library emits an event for the application to handle offer/answer exchange.
Testing
-
Master: C SDK, Viewer: JS SDK on Chrome
- Modified the C SDK sample to ensure no valid candidate pairs are formed to trigger an ICE restart and succeed post restart
- Disconnected ethernet and reconnected to ensure ICE restart allows communication to continue
- Disconnected ethernet to allow connection via WiFi to test out signaling reconnect. ICE restart does not help here since the websocket on the other peer is closed but the SDP offer is supposedly successfully sent.
-
Master: C SDK, Viewer: JS SDK on Firefox
- Firefox does not work with reconnection. The issue is on DTLS where, firefox does not seem to work if the remote generates a new fingerprint.
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.