add convenience methods to participant (#3016)
* add convenience methods to participant * tidy
This commit is contained in:
@@ -370,6 +370,11 @@ func (p *ParticipantImpl) IsRecorder() bool {
|
||||
return grants.GetParticipantKind() == livekit.ParticipantInfo_EGRESS || grants.Video.Recorder
|
||||
}
|
||||
|
||||
func (p *ParticipantImpl) IsAgent() bool {
|
||||
grants := p.grants.Load()
|
||||
return grants.GetParticipantKind() == livekit.ParticipantInfo_AGENT || grants.Video.Agent
|
||||
}
|
||||
|
||||
func (p *ParticipantImpl) IsDependent() bool {
|
||||
grants := p.grants.Load()
|
||||
switch grants.GetParticipantKind() {
|
||||
@@ -615,6 +620,10 @@ func (p *ParticipantImpl) CanSkipBroadcast() bool {
|
||||
return !p.requireBroadcast
|
||||
}
|
||||
|
||||
func (p *ParticipantImpl) VersionNumber() uint32 {
|
||||
return p.version.Load()
|
||||
}
|
||||
|
||||
func (p *ParticipantImpl) ToProtoWithVersion() (*livekit.ParticipantInfo, utils.TimedVersion) {
|
||||
if p.dirty.Load() {
|
||||
p.lock.Lock()
|
||||
|
||||
Reference in New Issue
Block a user