Add option to issue full reconnect on a publication error. (#1214)
* Add option to issue full reconnect on a publication error. Leaving the publication error timeout at 30 seconds as there are some publications taking long. Also, there are cases where the peer connection fails after 30 seconds. The peer connection failure happens after publication error is detected. But, 30 seconds is a good amount of time for publication to establish. * prevent recursive lock
This commit is contained in:
@@ -280,6 +280,11 @@ func (r *RoomManager) StartSession(
|
||||
if r.config.RTC.AllowTCPFallback != nil {
|
||||
allowFallback = *r.config.RTC.AllowTCPFallback
|
||||
}
|
||||
// default do not force full reconnect on a publication error
|
||||
reconnectOnPublicationError := false
|
||||
if r.config.RTC.ReconnectOnPublicationError != nil {
|
||||
reconnectOnPublicationError = *r.config.RTC.ReconnectOnPublicationError
|
||||
}
|
||||
participant, err = rtc.NewParticipant(rtc.ParticipantParams{
|
||||
Identity: pi.Identity,
|
||||
Name: pi.Name,
|
||||
@@ -307,6 +312,7 @@ func (r *RoomManager) StartSession(
|
||||
}
|
||||
return nil
|
||||
},
|
||||
ReconnectOnPublicationError: reconnectOnPublicationError,
|
||||
})
|
||||
if err != nil {
|
||||
return err
|
||||
|
||||
Reference in New Issue
Block a user