Add option to require media sections when participant joining (#4347)
Negotiate media tracks at first sdp round
This commit is contained in:
@@ -80,6 +80,9 @@ const (
|
|||||||
|
|
||||||
PingIntervalSeconds = 5
|
PingIntervalSeconds = 5
|
||||||
PingTimeoutSeconds = 15
|
PingTimeoutSeconds = 15
|
||||||
|
|
||||||
|
audioSectionsCountWithJoinResponse = 3
|
||||||
|
videoSectionsCountWithJoinResponse = 3
|
||||||
)
|
)
|
||||||
|
|
||||||
var (
|
var (
|
||||||
@@ -222,6 +225,7 @@ type ParticipantParams struct {
|
|||||||
EnableDataTracks bool
|
EnableDataTracks bool
|
||||||
EnableRTPStreamRestartDetection bool
|
EnableRTPStreamRestartDetection bool
|
||||||
ForceBackupCodecPolicySimulcast bool
|
ForceBackupCodecPolicySimulcast bool
|
||||||
|
RequireMediaSectionWithJoinResponse bool
|
||||||
}
|
}
|
||||||
|
|
||||||
type ParticipantImpl struct {
|
type ParticipantImpl struct {
|
||||||
|
|||||||
@@ -67,6 +67,10 @@ func (p *ParticipantImpl) SendJoinResponse(joinResponse *livekit.JoinResponse) e
|
|||||||
p.queuedUpdates = nil
|
p.queuedUpdates = nil
|
||||||
p.updateLock.Unlock()
|
p.updateLock.Unlock()
|
||||||
|
|
||||||
|
if p.params.RequireMediaSectionWithJoinResponse {
|
||||||
|
p.sendMediaSectionsRequirement(audioSectionsCountWithJoinResponse, videoSectionsCountWithJoinResponse)
|
||||||
|
}
|
||||||
|
|
||||||
if len(queuedUpdates) > 0 {
|
if len(queuedUpdates) > 0 {
|
||||||
return p.SendParticipantUpdate(queuedUpdates)
|
return p.SendParticipantUpdate(queuedUpdates)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user