Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

call get ice servers when offer is received to avoid stale ice server… #86

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

chehefen
Copy link

… credential

Issue #, if available:

Description of changes:

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@abrenaut
Copy link

This fixes the issue of stale ice server credentials but RTCPeerConnection.setConfiguration() is not supported in Firefox.

@@ -122,8 +99,15 @@ async function startMaster(localView, remoteView, formValues, onStatsReport, onR
master.signalingClient.on('sdpOffer', async (offer, remoteClientId) => {
console.log('[MASTER] Received SDP offer from client: ' + remoteClientId);

// Get ICE server configuration.
const getIceServerConfigPromise = master.kinesisVideoSignalingChannelsClient
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should await here, and pass the configuration directly to RTCPeerConnection instead of using setConfiguration.

Copy link
Contributor

@lherman-cs lherman-cs left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@MixMasterMitch
Copy link
Contributor

So a tradeoff with this approach is that the startup time might be increased due to having to fetch a new ICEServerConfig before the browser can start gathering ICE candidates on the master side.

  • Am I perhaps missing something on the potential latency impact?
  • Are there any alternative ways to accomplish the same thing (having non-stale TURN credentials)? Perhaps the master could periodically refresh the TURN credentials instead? Or even keep a pool of non-stale credentials?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants