@@ -161,17 +161,18 @@ func GetDisconnectionReason(reason livekit.DisconnectReason) DisconnectionReason
161161}
162162
163163type RoomCallback struct {
164- OnDisconnected func ()
165- OnDisconnectedWithReason func (reason DisconnectionReason )
166- OnParticipantConnected func (* RemoteParticipant )
167- OnParticipantDisconnected func (* RemoteParticipant )
168- OnActiveSpeakersChanged func ([]Participant )
169- OnRoomMetadataChanged func (metadata string )
170- OnRecordingStatusChanged func (isRecording bool )
171- OnRoomMoved func (roomName string , token string )
172- OnReconnecting func ()
173- OnReconnected func ()
174- OnLocalTrackSubscribed func (publication * LocalTrackPublication , lp * LocalParticipant )
164+ OnDisconnected func ()
165+ OnDisconnectedWithReason func (reason DisconnectionReason )
166+ OnParticipantConnected func (* RemoteParticipant )
167+ OnParticipantDisconnected func (* RemoteParticipant )
168+ OnParticipantDisconnectedWithReason func (* RemoteParticipant , livekit.DisconnectReason )
169+ OnActiveSpeakersChanged func ([]Participant )
170+ OnRoomMetadataChanged func (metadata string )
171+ OnRecordingStatusChanged func (isRecording bool )
172+ OnRoomMoved func (roomName string , token string )
173+ OnReconnecting func ()
174+ OnReconnected func ()
175+ OnLocalTrackSubscribed func (publication * LocalTrackPublication , lp * LocalParticipant )
175176
176177 // participant events are sent to the room as well
177178 ParticipantCallback
@@ -183,17 +184,18 @@ func NewRoomCallback() *RoomCallback {
183184 return & RoomCallback {
184185 ParticipantCallback : * pc ,
185186
186- OnDisconnected : func () {},
187- OnDisconnectedWithReason : func (reason DisconnectionReason ) {},
188- OnParticipantConnected : func (participant * RemoteParticipant ) {},
189- OnParticipantDisconnected : func (participant * RemoteParticipant ) {},
190- OnActiveSpeakersChanged : func (participants []Participant ) {},
191- OnRoomMetadataChanged : func (metadata string ) {},
192- OnRecordingStatusChanged : func (isRecording bool ) {},
193- OnRoomMoved : func (roomName string , token string ) {},
194- OnReconnecting : func () {},
195- OnReconnected : func () {},
196- OnLocalTrackSubscribed : func (publication * LocalTrackPublication , lp * LocalParticipant ) {},
187+ OnDisconnected : func () {},
188+ OnDisconnectedWithReason : func (reason DisconnectionReason ) {},
189+ OnParticipantConnected : func (participant * RemoteParticipant ) {},
190+ OnParticipantDisconnected : func (participant * RemoteParticipant ) {},
191+ OnParticipantDisconnectedWithReason : func (participant * RemoteParticipant , reason livekit.DisconnectReason ) {},
192+ OnActiveSpeakersChanged : func (participants []Participant ) {},
193+ OnRoomMetadataChanged : func (metadata string ) {},
194+ OnRecordingStatusChanged : func (isRecording bool ) {},
195+ OnRoomMoved : func (roomName string , token string ) {},
196+ OnReconnecting : func () {},
197+ OnReconnected : func () {},
198+ OnLocalTrackSubscribed : func (publication * LocalTrackPublication , lp * LocalParticipant ) {},
197199 }
198200}
199201
@@ -215,6 +217,9 @@ func (cb *RoomCallback) Merge(other *RoomCallback) {
215217 if other .OnParticipantDisconnected != nil {
216218 cb .OnParticipantDisconnected = other .OnParticipantDisconnected
217219 }
220+ if other .OnParticipantDisconnectedWithReason != nil {
221+ cb .OnParticipantDisconnectedWithReason = other .OnParticipantDisconnectedWithReason
222+ }
218223 if other .OnActiveSpeakersChanged != nil {
219224 cb .OnActiveSpeakersChanged = other .OnActiveSpeakersChanged
220225 }
0 commit comments