Remembering user's device selections for the next call #1840
prprabhu-ms
started this conversation in
Show and tell
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Smooth device selection is a critical part of the user experience of a communications application. We have heard repeatedly from folks how important it is to reduce the friction in having the end-user all set up for their call, and we continue to innovate in this space.
Here, I show how you can save the user's device selection across application sessions. Both the
CallComposite
andCallWithChatComposite
include a pre-call configuration screen where the user can select the audio and video devices they want to use for the call.The call control bar also allows the user to switch devices during a call.
You can use the web localStorage API to save the user's device selections at the end of a call, and pre-populate the selections in future calls. Both
CallAdapter
andCallWithChatAdapter
expose information about the user's selected devices, including anid
that is stable across browser sessions.Save selected devices when a call ends
The most straightforward way to create and adapter is to use the included React custom hooks.
The hooks include an optional callback to augment the created adapter. You can use that to subscribe to the
'callEnded'
event that fires when the call ends.Restore saved devices when starting a call
You can use the same post-creation callback to restore the selected devices in future sessions.
Put it all together
The code showed how to save and restore the selected camera, but you can do the same for the selected microphone and speaker. This way, when the user joins their next call from your application, they can continue where they left off!
Beta Was this translation helpful? Give feedback.
All reactions