Every WebRTC session from now on will now start with a describeMediaStorageConfiguration. We need to use the result of this to determine which mode to run the sample application in.
Add JoinStorageSession retries. This only applies in When in Ingestion & Storage mode.
If no SDP offer was received over the WebSocket within 6 seconds, we try again, with some backoff and jitter.
If we receive SDP offers from the KVS Ingestion & Storage peer within a 10-minute window, and the peer connection failed to be established 5 times within that 10-minute window, we will exit the application. The user would need to manually restart the sample in that case.
When the connection to the KVS Ingestion & Storage peer is lost, we will attempt to reconnect by making a JoinStorageSession API call. Due to the 1-hour session limit, we will lose connection by that point, and attempt to connect again.
Rename WebRTC Storage section to WebRTC Storage and Ingestion
Make the WebRTC Storage and Ingestion section hidden by default, can expand the section to show the options.
Add a button allowing users to configure which stream to ingest and store the media to:
Add a button to print what is the current mediaStorageConfiguration for the signaling channel.
Print selected options to the logs when the sample is started.
Rename the "Ingest media" checkbox, to "Ingestion and storage peer joins automatically". The behavior of this button has been tweaked to have no effect (i.e. don't call JoinStorageSession) when the media storage configuration is DISABLED. This checkbox is also enabled by default.
As a result, the "Audio and video" checkboxes needing to be checked for WebRTC ingestion and storage has been moved to an application runtime check.
Add tooltip for the "Ingestion and storage peer joins automatically" checkbox.
Since regular viewers can no longer join, when this feature is enabled, add an error message when the viewer tries to connect to a channel with media storage is enabled (prevent failing silently).
(By @stefankiesz) add a button to print all of the channels currently configured for ingestion.
Why was it changed?
In case JoinStorageSession is called and KVS backend is experiencing problems, retry the call in order to receive an SDP offer from the Ingestion and Storage Peer.
The 5 failure attempts within 10 minutes was added in order to prevent the following infinite loop, where we will continuously attempt to establish a connection:
Call JoinStorageSession
Receive SDP offer
Send Answer, exchange ice candidates, etc
Peer connection failed to be established (e.g. due to firewall)
Call JoinStorageSession, since the peer connection failed.
Receive SDP offer
And so on.
The rest of the changes were made to enhance the user experience. Needing to use the AWS CLI to configure the media storage configuration made that part not "fit" with the rest of the sample (where everything can be done on the web).
WebRTC Ingestion & Storage section was made hidden by default because it adds a bunch of clutter. Users using the regular WebRTC will have no need for this.
Testing
Manually tested
Tested reconnect by running sample for multiple hours, and also randomly disconnecting from internet until the log message "connection peer to failed" shows up before connecting to internet again.
Tested exponential backoff/jitter by putting a return; as the first thing in SiganlingClient.ts onMessage
Tested 5 retries within 10 minutes by disabling STUN and TURN.
Update media storage configuration button with empty streamname, and to a new streamname.
Click describe storage configuration button, the output is as expected.
Click the list channels button, confirm that the output is as expected.
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.
What was changed?
Every WebRTC session from now on will now start with a describeMediaStorageConfiguration. We need to use the result of this to determine which mode to run the sample application in.
Add JoinStorageSession retries. This only applies in When in Ingestion & Storage mode.
Rename WebRTC Storage section to WebRTC Storage and Ingestion
Make the WebRTC Storage and Ingestion section hidden by default, can expand the section to show the options.
Add a button allowing users to configure which stream to ingest and store the media to:
Add a button to print what is the current mediaStorageConfiguration for the signaling channel.
Add tooltip for the "Ingestion and storage peer joins automatically" checkbox.
Since regular viewers can no longer join, when this feature is enabled, add an error message when the viewer tries to connect to a channel with media storage is enabled (prevent failing silently).
(By @stefankiesz) add a button to print all of the channels currently configured for ingestion.
Why was it changed?
Testing
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.