Skip to content

Commit 9b79483

Browse files
authored
feat(RoomService): implement forward participant api (#115)
* feat(RoomService): implement forward participant api * chore: add changeset
1 parent 4747d93 commit 9b79483

File tree

5 files changed

+26
-3
lines changed

5 files changed

+26
-3
lines changed

.changeset/spicy-frogs-tease.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"server-sdk-kotlin": minor
3+
---
4+
5+
RoomService: implement forward participant api

.gitignore

+2-1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ build/
66
local.properties
77

88
### IntelliJ IDEA ###
9+
.idea/AndroidProjectSystem.xml
910
.idea/modules.xml
1011
.idea/jarRepositories.xml
1112
.idea/compiler.xml
@@ -53,4 +54,4 @@ bin/
5354
node_modules/
5455
npm-debug.log
5556
yarn-debug.log
56-
yarn-error.log
57+
yarn-error.log

protocol

Submodule protocol updated 77 files

src/main/kotlin/io/livekit/server/RoomService.kt

+5-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2024 LiveKit, Inc.
2+
* Copyright 2024-2025 LiveKit, Inc.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -68,6 +68,10 @@ interface RoomService {
6868
@POST("/twirp/livekit.RoomService/RemoveParticipant")
6969
fun removeParticipant(@Body request: LivekitRoom.RoomParticipantIdentity, @Header("Authorization") authorization: String): Call<Void?>
7070

71+
@Headers("Content-Type: application/protobuf")
72+
@POST("/twirp/livekit.RoomService/ForwardParticipant")
73+
fun forwardParticipant(@Body request: LivekitRoom.ForwardParticipantRequest, @Header("Authorization") authorization: String): Call<LivekitRoom.ForwardParticipantResponse>
74+
7175
@Headers("Content-Type: application/protobuf")
7276
@POST("/twirp/livekit.RoomService/MutePublishedTrack")
7377
fun mutePublishedTrack(

src/main/kotlin/io/livekit/server/RoomServiceClient.kt

+13
Original file line numberDiff line numberDiff line change
@@ -189,6 +189,19 @@ class RoomServiceClient(
189189
return service.removeParticipant(request, credentials)
190190
}
191191

192+
fun forwardParticipant(roomName: String, identity: String, destinationRoomName: String): Call<LivekitRoom.ForwardParticipantResponse> {
193+
val request = LivekitRoom.ForwardParticipantRequest.newBuilder()
194+
.setRoom(roomName)
195+
.setIdentity(identity)
196+
.setDestinationRoom(destinationRoomName)
197+
.build()
198+
val credentials = authHeader(
199+
RoomAdmin(true),
200+
RoomName(roomName),
201+
)
202+
return service.forwardParticipant(request, credentials)
203+
}
204+
192205
/**
193206
* Mutes a track that the participant has published.
194207
* @param roomName

0 commit comments

Comments
 (0)