Skip to content

Commit 1264ec0

Browse files
authored
feat(room_service): move participant api (#440)
1 parent 2b781fe commit 1264ec0

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed

livekit-api/livekit/api/room_service.py

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@
2020
UpdateSubscriptionsResponse,
2121
ForwardParticipantRequest,
2222
ForwardParticipantResponse,
23+
MoveParticipantRequest,
24+
MoveParticipantResponse,
2325
)
2426
from livekit.protocol.models import Room, ParticipantInfo
2527
from ._service import Service
@@ -223,6 +225,32 @@ async def forward_participant(self, forward: ForwardParticipantRequest) -> None:
223225
ForwardParticipantResponse,
224226
)
225227

228+
async def move_participant(self, move: MoveParticipantRequest) -> None:
229+
"""Moves a participant from one room to another.
230+
231+
This feature is only available for LiveKit Cloud/Private Cloud.
232+
233+
Args:
234+
move (MoveParticipantRequest): arg containing:
235+
- room: str - Room name
236+
- identity: str - Participant identity
237+
- destination_room: str - Destination room name
238+
"""
239+
# currently nothing is returned
240+
await self._client.request(
241+
SVC,
242+
"MoveParticipant",
243+
move,
244+
self._auth_header(
245+
VideoGrants(
246+
room_admin=True,
247+
room=move.room,
248+
destination_room=move.destination_room,
249+
)
250+
),
251+
MoveParticipantResponse,
252+
)
253+
226254
async def mute_published_track(
227255
self,
228256
update: MuteRoomTrackRequest,

0 commit comments

Comments
 (0)