github.com/whoyao/protocol@v0.0.0-20230519045905-2d8ace718ca5/livekit_room.proto (about) 1 syntax = "proto3"; 2 3 package livekit; 4 option go_package = "github.com/livekit/protocol/livekit"; 5 option csharp_namespace = "LiveKit.Proto"; 6 option ruby_package = "LiveKit::Proto"; 7 8 import "livekit_models.proto"; 9 import "livekit_egress.proto"; 10 11 // Room service that can be performed on any node 12 // they are Twirp-based HTTP req/responses 13 service RoomService { 14 // Creates a room with settings. Requires `roomCreate` permission. 15 // This method is optional; rooms are automatically created when clients connect to them for the first time. 16 rpc CreateRoom(CreateRoomRequest) returns (Room); 17 18 // List rooms that are active on the server. Requires `roomList` permission. 19 rpc ListRooms(ListRoomsRequest) returns (ListRoomsResponse); 20 21 // Deletes an existing room by name or id. Requires `roomCreate` permission. 22 // DeleteRoom will disconnect all participants that are currently in the room. 23 rpc DeleteRoom(DeleteRoomRequest) returns (DeleteRoomResponse); 24 25 // Lists participants in a room, Requires `roomAdmin` 26 rpc ListParticipants(ListParticipantsRequest) returns (ListParticipantsResponse); 27 28 // Get information on a specific participant, Requires `roomAdmin` 29 rpc GetParticipant(RoomParticipantIdentity) returns (ParticipantInfo); 30 31 // Removes a participant from room. Requires `roomAdmin` 32 rpc RemoveParticipant(RoomParticipantIdentity) returns (RemoveParticipantResponse); 33 34 // Mute/unmute a participant's track, Requires `roomAdmin` 35 rpc MutePublishedTrack(MuteRoomTrackRequest) returns (MuteRoomTrackResponse); 36 37 // Update participant metadata, will cause updates to be broadcasted to everyone in the room. Requires `roomAdmin` 38 rpc UpdateParticipant(UpdateParticipantRequest) returns (ParticipantInfo); 39 40 // Subscribes or unsubscribe a participant from tracks. Requires `roomAdmin` 41 rpc UpdateSubscriptions(UpdateSubscriptionsRequest) returns (UpdateSubscriptionsResponse); 42 43 // Send data over data channel to participants in a room, Requires `roomAdmin` 44 rpc SendData(SendDataRequest) returns (SendDataResponse); 45 46 // Update room metadata, will cause updates to be broadcasted to everyone in the room, Requires `roomAdmin` 47 rpc UpdateRoomMetadata (UpdateRoomMetadataRequest) returns (Room); 48 } 49 50 message CreateRoomRequest { 51 // name of the room 52 string name = 1; 53 // number of seconds to keep the room open if no one joins 54 uint32 empty_timeout = 2; 55 // limit number of participants that can be in a room 56 uint32 max_participants = 3; 57 // override the node room is allocated to, for debugging 58 string node_id = 4; 59 // metadata of room 60 string metadata = 5; 61 // egress 62 RoomEgress egress = 6; 63 } 64 65 message RoomEgress { 66 RoomCompositeEgressRequest room = 1; 67 AutoTrackEgress tracks = 2; 68 } 69 70 message ListRoomsRequest { 71 // when set, will only return rooms with name match 72 repeated string names = 1; 73 } 74 75 message ListRoomsResponse { 76 repeated Room rooms = 1; 77 } 78 79 message DeleteRoomRequest { 80 // name of the room 81 string room = 1; 82 } 83 84 message DeleteRoomResponse { 85 } 86 87 message ListParticipantsRequest { 88 // name of the room 89 string room = 1; 90 } 91 92 message ListParticipantsResponse { 93 repeated ParticipantInfo participants = 1; 94 } 95 96 message RoomParticipantIdentity { 97 // name of the room 98 string room = 1; 99 // identity of the participant 100 string identity = 2; 101 } 102 103 message RemoveParticipantResponse { 104 } 105 106 message MuteRoomTrackRequest { 107 // name of the room 108 string room = 1; 109 string identity = 2; 110 // sid of the track to mute 111 string track_sid = 3; 112 // set to true to mute, false to unmute 113 bool muted = 4; 114 } 115 116 message MuteRoomTrackResponse { 117 TrackInfo track = 1; 118 } 119 120 message UpdateParticipantRequest { 121 string room = 1; 122 string identity = 2; 123 // metadata to update. skipping updates if left empty 124 string metadata = 3; 125 // set to update the participant's permissions 126 ParticipantPermission permission = 4; 127 // display name to update 128 string name = 5; 129 } 130 131 message UpdateSubscriptionsRequest { 132 string room = 1; 133 string identity = 2; 134 // list of sids of tracks 135 repeated string track_sids = 3; 136 // set to true to subscribe, false to unsubscribe from tracks 137 bool subscribe = 4; 138 // list of participants and their tracks 139 repeated ParticipantTracks participant_tracks = 5; 140 } 141 142 message UpdateSubscriptionsResponse { 143 // empty for now 144 } 145 146 message SendDataRequest { 147 string room = 1; 148 bytes data = 2; 149 DataPacket.Kind kind = 3; 150 repeated string destination_sids = 4; 151 optional string topic = 5; 152 } 153 154 message SendDataResponse { 155 // 156 } 157 158 message UpdateRoomMetadataRequest { 159 string room = 1; 160 // metadata to update. skipping updates if left empty 161 string metadata = 2; 162 }