Identify LiveKit room participants by user id, not peer id
This way, their participant id can remain the same when they reconnect.
This commit is contained in:
parent
c2f5381e5a
commit
ad37034960
9 changed files with 55 additions and 42 deletions
|
@ -199,7 +199,7 @@ async fn test_basic_calls(
|
|||
assert_eq!(participant_id, client_a.peer_id().unwrap());
|
||||
room_b.read_with(cx_b, |room, _| {
|
||||
assert_eq!(
|
||||
room.remote_participants()[&client_a.peer_id().unwrap()]
|
||||
room.remote_participants()[&client_a.user_id().unwrap()]
|
||||
.tracks
|
||||
.len(),
|
||||
1
|
||||
|
|
|
@ -850,7 +850,7 @@ async fn create_room(
|
|||
.trace_err()
|
||||
{
|
||||
if let Some(token) = live_kit
|
||||
.room_token(&live_kit_room, &session.connection_id.to_string())
|
||||
.room_token(&live_kit_room, &session.user_id.to_string())
|
||||
.trace_err()
|
||||
{
|
||||
Some(proto::LiveKitConnectionInfo {
|
||||
|
@ -918,7 +918,7 @@ async fn join_room(
|
|||
|
||||
let live_kit_connection_info = if let Some(live_kit) = session.live_kit_client.as_ref() {
|
||||
if let Some(token) = live_kit
|
||||
.room_token(&room.live_kit_room, &session.connection_id.to_string())
|
||||
.room_token(&room.live_kit_room, &session.user_id.to_string())
|
||||
.trace_err()
|
||||
{
|
||||
Some(proto::LiveKitConnectionInfo {
|
||||
|
@ -2066,7 +2066,7 @@ async fn leave_room_for_session(session: &Session) -> Result<()> {
|
|||
|
||||
if let Some(live_kit) = session.live_kit_client.as_ref() {
|
||||
live_kit
|
||||
.remove_participant(live_kit_room.clone(), session.connection_id.to_string())
|
||||
.remove_participant(live_kit_room.clone(), session.user_id.to_string())
|
||||
.await
|
||||
.trace_err();
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue