Track subscription operations per source track. (#1248)
This commit is contained in:
@@ -93,6 +93,9 @@ type RTCConfig struct {
|
|||||||
|
|
||||||
// force a reconnect on a publication error
|
// force a reconnect on a publication error
|
||||||
ReconnectOnPublicationError *bool `yaml:"reconnect_on_publication_error,omitempty"`
|
ReconnectOnPublicationError *bool `yaml:"reconnect_on_publication_error,omitempty"`
|
||||||
|
|
||||||
|
// force a reconnect on a subscription error
|
||||||
|
ReconnectOnSubscriptionError *bool `yaml:"reconnect_on_subscription_error,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type TURNServer struct {
|
type TURNServer struct {
|
||||||
|
|||||||
@@ -47,6 +47,7 @@ func TestGeneratedFlags(t *testing.T) {
|
|||||||
set.Uint("prometheus_port", 9999, "") // uint32
|
set.Uint("prometheus_port", 9999, "") // uint32
|
||||||
set.Bool("rtc.allow_tcp_fallback", true, "") // pointer
|
set.Bool("rtc.allow_tcp_fallback", true, "") // pointer
|
||||||
set.Bool("rtc.reconnect_on_publication_error", true, "") // pointer
|
set.Bool("rtc.reconnect_on_publication_error", true, "") // pointer
|
||||||
|
set.Bool("rtc.reconnect_on_subscription_error", false, "") // pointer
|
||||||
|
|
||||||
c := cli.NewContext(app, set, nil)
|
c := cli.NewContext(app, set, nil)
|
||||||
conf, err := NewConfig("", true, c, nil)
|
conf, err := NewConfig("", true, c, nil)
|
||||||
@@ -55,8 +56,13 @@ func TestGeneratedFlags(t *testing.T) {
|
|||||||
require.True(t, conf.RTC.UseICELite)
|
require.True(t, conf.RTC.UseICELite)
|
||||||
require.Equal(t, "localhost:6379", conf.Redis.Address)
|
require.Equal(t, "localhost:6379", conf.Redis.Address)
|
||||||
require.Equal(t, uint32(9999), conf.PrometheusPort)
|
require.Equal(t, uint32(9999), conf.PrometheusPort)
|
||||||
|
|
||||||
require.NotNil(t, conf.RTC.AllowTCPFallback)
|
require.NotNil(t, conf.RTC.AllowTCPFallback)
|
||||||
require.True(t, *conf.RTC.AllowTCPFallback)
|
require.True(t, *conf.RTC.AllowTCPFallback)
|
||||||
|
|
||||||
require.NotNil(t, conf.RTC.ReconnectOnPublicationError)
|
require.NotNil(t, conf.RTC.ReconnectOnPublicationError)
|
||||||
require.True(t, *conf.RTC.ReconnectOnPublicationError)
|
require.True(t, *conf.RTC.ReconnectOnPublicationError)
|
||||||
|
|
||||||
|
require.NotNil(t, conf.RTC.ReconnectOnSubscriptionError)
|
||||||
|
require.False(t, *conf.RTC.ReconnectOnSubscriptionError)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -428,7 +428,7 @@ func (t *MediaTrackReceiver) removePendingSubscribeOp(subscriberID livekit.Parti
|
|||||||
|
|
||||||
// AddSubscriber subscribes sub to current mediaTrack
|
// AddSubscriber subscribes sub to current mediaTrack
|
||||||
func (t *MediaTrackReceiver) AddSubscriber(sub types.LocalParticipant) error {
|
func (t *MediaTrackReceiver) AddSubscriber(sub types.LocalParticipant) error {
|
||||||
if sub.EnqueueSubscribeTrack(t.ID(), t.params.IsRelayed, t.addSubscriber) {
|
if sub.EnqueueSubscribeTrack(t.ID(), t.params.MediaTrack, t.params.IsRelayed, t.addSubscriber) {
|
||||||
t.addPendingSubscribeOp(sub.ID())
|
t.addPendingSubscribeOp(sub.ID())
|
||||||
}
|
}
|
||||||
return nil
|
return nil
|
||||||
@@ -506,7 +506,7 @@ func (t *MediaTrackReceiver) RemoveSubscriber(subscriberID livekit.ParticipantID
|
|||||||
}
|
}
|
||||||
|
|
||||||
sub := subTrack.Subscriber()
|
sub := subTrack.Subscriber()
|
||||||
if sub.EnqueueUnsubscribeTrack(subTrack.ID(), t.params.IsRelayed, willBeResumed, t.removeSubscriber) {
|
if sub.EnqueueUnsubscribeTrack(subTrack.ID(), t.params.MediaTrack, t.params.IsRelayed, willBeResumed, t.removeSubscriber) {
|
||||||
t.addPendingSubscribeOp(sub.ID())
|
t.addPendingSubscribeOp(sub.ID())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -248,7 +248,7 @@ func (t *MediaTrackSubscriptions) AddSubscriber(sub types.LocalParticipant, wr *
|
|||||||
|
|
||||||
// since sub will lock, run it in a goroutine to avoid deadlocks
|
// since sub will lock, run it in a goroutine to avoid deadlocks
|
||||||
go func() {
|
go func() {
|
||||||
sub.AddSubscribedTrack(subTrack)
|
sub.AddSubscribedTrack(subTrack, t.params.MediaTrack)
|
||||||
if !replacedTrack {
|
if !replacedTrack {
|
||||||
sub.Negotiate(false)
|
sub.Negotiate(false)
|
||||||
}
|
}
|
||||||
@@ -424,7 +424,7 @@ func (t *MediaTrackSubscriptions) downTrackClosed(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
sub.RemoveSubscribedTrack(subTrack)
|
sub.RemoveSubscribedTrack(subTrack, t.params.MediaTrack)
|
||||||
if !willBeResumed {
|
if !willBeResumed {
|
||||||
sub.Negotiate(false)
|
sub.Negotiate(false)
|
||||||
}
|
}
|
||||||
|
|||||||
+20
-9
@@ -89,6 +89,7 @@ type ParticipantParams struct {
|
|||||||
TURNSEnabled bool
|
TURNSEnabled bool
|
||||||
GetParticipantInfo func(pID livekit.ParticipantID) *livekit.ParticipantInfo
|
GetParticipantInfo func(pID livekit.ParticipantID) *livekit.ParticipantInfo
|
||||||
ReconnectOnPublicationError bool
|
ReconnectOnPublicationError bool
|
||||||
|
ReconnectOnSubscriptionError bool
|
||||||
}
|
}
|
||||||
|
|
||||||
type ParticipantImpl struct {
|
type ParticipantImpl struct {
|
||||||
@@ -202,6 +203,7 @@ func NewParticipant(params ParticipantParams) (*ParticipantImpl, error) {
|
|||||||
p.SetResponseSink(params.Sink)
|
p.SetResponseSink(params.Sink)
|
||||||
|
|
||||||
p.supervisor.OnPublicationError(p.onPublicationError)
|
p.supervisor.OnPublicationError(p.onPublicationError)
|
||||||
|
p.supervisor.OnSubscriptionError(p.onSubscriptionError)
|
||||||
|
|
||||||
var err error
|
var err error
|
||||||
// keep last participants and when updates were sent
|
// keep last participants and when updates were sent
|
||||||
@@ -919,9 +921,10 @@ func (p *ParticipantImpl) VerifySubscribeParticipantInfo(pID livekit.Participant
|
|||||||
}
|
}
|
||||||
|
|
||||||
// AddSubscribedTrack adds a track to the participant's subscribed list
|
// AddSubscribedTrack adds a track to the participant's subscribed list
|
||||||
func (p *ParticipantImpl) AddSubscribedTrack(subTrack types.SubscribedTrack) {
|
func (p *ParticipantImpl) AddSubscribedTrack(subTrack types.SubscribedTrack, sourceTrack types.MediaTrack) {
|
||||||
p.lock.Lock()
|
p.lock.Lock()
|
||||||
if v, ok := p.trackPublisherVersion[subTrack.ID()]; ok && v > subTrack.PublisherVersion() {
|
if v, ok := p.trackPublisherVersion[subTrack.ID()]; ok && v > subTrack.PublisherVersion() {
|
||||||
|
p.supervisor.SetSubscribedTrack(subTrack.ID(), subTrack, sourceTrack)
|
||||||
p.lock.Unlock()
|
p.lock.Unlock()
|
||||||
p.params.Logger.Infow("ignoring add subscribedTrack from older version",
|
p.params.Logger.Infow("ignoring add subscribedTrack from older version",
|
||||||
"current", v,
|
"current", v,
|
||||||
@@ -939,7 +942,7 @@ func (p *ParticipantImpl) AddSubscribedTrack(subTrack types.SubscribedTrack) {
|
|||||||
onSubscribedTo := p.onSubscribedTo
|
onSubscribedTo := p.onSubscribedTo
|
||||||
|
|
||||||
p.subscribedTracks[subTrack.ID()] = subTrack
|
p.subscribedTracks[subTrack.ID()] = subTrack
|
||||||
p.supervisor.SetSubscribedTrack(subTrack.ID(), subTrack)
|
p.supervisor.SetSubscribedTrack(subTrack.ID(), subTrack, sourceTrack)
|
||||||
|
|
||||||
settings := p.subscribedTracksSettings[subTrack.ID()]
|
settings := p.subscribedTracksSettings[subTrack.ID()]
|
||||||
p.lock.Unlock()
|
p.lock.Unlock()
|
||||||
@@ -966,9 +969,10 @@ func (p *ParticipantImpl) AddSubscribedTrack(subTrack types.SubscribedTrack) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// RemoveSubscribedTrack removes a track to the participant's subscribed list
|
// RemoveSubscribedTrack removes a track to the participant's subscribed list
|
||||||
func (p *ParticipantImpl) RemoveSubscribedTrack(subTrack types.SubscribedTrack) {
|
func (p *ParticipantImpl) RemoveSubscribedTrack(subTrack types.SubscribedTrack, sourceTrack types.MediaTrack) {
|
||||||
p.lock.Lock()
|
p.lock.Lock()
|
||||||
if v, ok := p.trackPublisherVersion[subTrack.ID()]; ok && v > subTrack.PublisherVersion() {
|
if v, ok := p.trackPublisherVersion[subTrack.ID()]; ok && v > subTrack.PublisherVersion() {
|
||||||
|
p.supervisor.ClearSubscribedTrack(subTrack.ID(), subTrack, sourceTrack)
|
||||||
p.lock.Unlock()
|
p.lock.Unlock()
|
||||||
p.params.Logger.Infow("ignoring remove subscribedTrack from older version",
|
p.params.Logger.Infow("ignoring remove subscribedTrack from older version",
|
||||||
"current", v,
|
"current", v,
|
||||||
@@ -984,7 +988,7 @@ func (p *ParticipantImpl) RemoveSubscribedTrack(subTrack types.SubscribedTrack)
|
|||||||
p.trackPublisherVersion[subTrack.ID()] = subTrack.PublisherVersion()
|
p.trackPublisherVersion[subTrack.ID()] = subTrack.PublisherVersion()
|
||||||
|
|
||||||
delete(p.subscribedTracks, subTrack.ID())
|
delete(p.subscribedTracks, subTrack.ID())
|
||||||
p.supervisor.ClearSubscribedTrack(subTrack.ID(), subTrack)
|
p.supervisor.ClearSubscribedTrack(subTrack.ID(), subTrack, sourceTrack)
|
||||||
|
|
||||||
// remove from subscribed map
|
// remove from subscribed map
|
||||||
numRemaining := 0
|
numRemaining := 0
|
||||||
@@ -2011,9 +2015,15 @@ func (p *ParticipantImpl) issueFullReconnect(reason types.ParticipantCloseReason
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (p *ParticipantImpl) onPublicationError(trackID livekit.TrackID) {
|
func (p *ParticipantImpl) onPublicationError(trackID livekit.TrackID) {
|
||||||
p.params.Logger.Infow("publication failed", "trackID", trackID)
|
|
||||||
if p.params.ReconnectOnPublicationError {
|
if p.params.ReconnectOnPublicationError {
|
||||||
p.params.Logger.Infow("starting full reconnect")
|
p.params.Logger.Infow("issuing full reconnect on publication error", "trackID", trackID)
|
||||||
|
p.issueFullReconnect(types.ParticipantCloseReasonPublicationError)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func (p *ParticipantImpl) onSubscriptionError(trackID livekit.TrackID) {
|
||||||
|
if p.params.ReconnectOnSubscriptionError {
|
||||||
|
p.params.Logger.Infow("issuing full reconnect on subscription error", "trackID", trackID)
|
||||||
p.issueFullReconnect(types.ParticipantCloseReasonPublicationError)
|
p.issueFullReconnect(types.ParticipantCloseReasonPublicationError)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -2023,7 +2033,7 @@ func (p *ParticipantImpl) onAnyTransportNegotiationFailed() {
|
|||||||
p.issueFullReconnect(types.ParticipantCloseReasonNegotiateFailed)
|
p.issueFullReconnect(types.ParticipantCloseReasonNegotiateFailed)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (p *ParticipantImpl) EnqueueSubscribeTrack(trackID livekit.TrackID, isRelayed bool, f func(sub types.LocalParticipant) error) bool {
|
func (p *ParticipantImpl) EnqueueSubscribeTrack(trackID livekit.TrackID, sourceTrack types.MediaTrack, isRelayed bool, f func(sub types.LocalParticipant) error) bool {
|
||||||
// do not queue subscription is participant is already closed/disconnected
|
// do not queue subscription is participant is already closed/disconnected
|
||||||
if p.isClosed.Load() || p.State() == livekit.ParticipantInfo_DISCONNECTED {
|
if p.isClosed.Load() || p.State() == livekit.ParticipantInfo_DISCONNECTED {
|
||||||
return false
|
return false
|
||||||
@@ -2031,7 +2041,7 @@ func (p *ParticipantImpl) EnqueueSubscribeTrack(trackID livekit.TrackID, isRelay
|
|||||||
|
|
||||||
p.params.Logger.Debugw("queuing subscribe", "trackID", trackID, "relayed", isRelayed)
|
p.params.Logger.Debugw("queuing subscribe", "trackID", trackID, "relayed", isRelayed)
|
||||||
|
|
||||||
p.supervisor.UpdateSubscription(trackID, true)
|
p.supervisor.UpdateSubscription(trackID, true, sourceTrack)
|
||||||
|
|
||||||
p.lock.Lock()
|
p.lock.Lock()
|
||||||
p.subscriptionRequestsQueue[trackID] = append(p.subscriptionRequestsQueue[trackID], SubscribeRequest{
|
p.subscriptionRequestsQueue[trackID] = append(p.subscriptionRequestsQueue[trackID], SubscribeRequest{
|
||||||
@@ -2046,13 +2056,14 @@ func (p *ParticipantImpl) EnqueueSubscribeTrack(trackID livekit.TrackID, isRelay
|
|||||||
|
|
||||||
func (p *ParticipantImpl) EnqueueUnsubscribeTrack(
|
func (p *ParticipantImpl) EnqueueUnsubscribeTrack(
|
||||||
trackID livekit.TrackID,
|
trackID livekit.TrackID,
|
||||||
|
sourceTrack types.MediaTrack,
|
||||||
isRelayed bool,
|
isRelayed bool,
|
||||||
willBeResumed bool,
|
willBeResumed bool,
|
||||||
f func(subscriberID livekit.ParticipantID, willBeResumed bool) error,
|
f func(subscriberID livekit.ParticipantID, willBeResumed bool) error,
|
||||||
) bool {
|
) bool {
|
||||||
p.params.Logger.Debugw("queuing unsubscribe", "trackID", trackID, "relayed", isRelayed)
|
p.params.Logger.Debugw("queuing unsubscribe", "trackID", trackID, "relayed", isRelayed)
|
||||||
|
|
||||||
p.supervisor.UpdateSubscription(trackID, false)
|
p.supervisor.UpdateSubscription(trackID, false, sourceTrack)
|
||||||
|
|
||||||
p.lock.Lock()
|
p.lock.Lock()
|
||||||
p.subscriptionRequestsQueue[trackID] = append(p.subscriptionRequestsQueue[trackID], SubscribeRequest{
|
p.subscriptionRequestsQueue[trackID] = append(p.subscriptionRequestsQueue[trackID], SubscribeRequest{
|
||||||
|
|||||||
@@ -18,24 +18,30 @@ type ParticipantSupervisorParams struct {
|
|||||||
Logger logger.Logger
|
Logger logger.Logger
|
||||||
}
|
}
|
||||||
|
|
||||||
|
type trackMonitor struct {
|
||||||
|
opMon types.OperationMonitor
|
||||||
|
err error
|
||||||
|
}
|
||||||
|
|
||||||
type ParticipantSupervisor struct {
|
type ParticipantSupervisor struct {
|
||||||
params ParticipantSupervisorParams
|
params ParticipantSupervisorParams
|
||||||
|
|
||||||
lock sync.RWMutex
|
lock sync.RWMutex
|
||||||
isPublisherConnected bool
|
isPublisherConnected bool
|
||||||
publications map[livekit.TrackID]types.OperationMonitor
|
publications map[livekit.TrackID]*trackMonitor
|
||||||
subscriptions map[livekit.TrackID]types.OperationMonitor
|
subscriptions map[livekit.TrackID]*trackMonitor
|
||||||
|
|
||||||
isStopped atomic.Bool
|
isStopped atomic.Bool
|
||||||
|
|
||||||
onPublicationError func(trackID livekit.TrackID)
|
onPublicationError func(trackID livekit.TrackID)
|
||||||
|
onSubscriptionError func(trackID livekit.TrackID)
|
||||||
}
|
}
|
||||||
|
|
||||||
func NewParticipantSupervisor(params ParticipantSupervisorParams) *ParticipantSupervisor {
|
func NewParticipantSupervisor(params ParticipantSupervisorParams) *ParticipantSupervisor {
|
||||||
p := &ParticipantSupervisor{
|
p := &ParticipantSupervisor{
|
||||||
params: params,
|
params: params,
|
||||||
publications: make(map[livekit.TrackID]types.OperationMonitor),
|
publications: make(map[livekit.TrackID]*trackMonitor),
|
||||||
subscriptions: make(map[livekit.TrackID]types.OperationMonitor),
|
subscriptions: make(map[livekit.TrackID]*trackMonitor),
|
||||||
}
|
}
|
||||||
|
|
||||||
go p.checkState()
|
go p.checkState()
|
||||||
@@ -61,12 +67,26 @@ func (p *ParticipantSupervisor) getOnPublicationError() func(trackID livekit.Tra
|
|||||||
return p.onPublicationError
|
return p.onPublicationError
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (p *ParticipantSupervisor) OnSubscriptionError(f func(trackID livekit.TrackID)) {
|
||||||
|
p.lock.Lock()
|
||||||
|
defer p.lock.Unlock()
|
||||||
|
|
||||||
|
p.onSubscriptionError = f
|
||||||
|
}
|
||||||
|
|
||||||
|
func (p *ParticipantSupervisor) getOnSubscriptionError() func(trackID livekit.TrackID) {
|
||||||
|
p.lock.RLock()
|
||||||
|
defer p.lock.RUnlock()
|
||||||
|
|
||||||
|
return p.onSubscriptionError
|
||||||
|
}
|
||||||
|
|
||||||
func (p *ParticipantSupervisor) SetPublisherPeerConnectionConnected(isConnected bool) {
|
func (p *ParticipantSupervisor) SetPublisherPeerConnectionConnected(isConnected bool) {
|
||||||
p.lock.Lock()
|
p.lock.Lock()
|
||||||
p.isPublisherConnected = isConnected
|
p.isPublisherConnected = isConnected
|
||||||
|
|
||||||
for _, pm := range p.publications {
|
for _, pm := range p.publications {
|
||||||
pm.PostEvent(types.OperationMonitorEventPublisherPeerConnectionConnected, p.isPublisherConnected)
|
pm.opMon.PostEvent(types.OperationMonitorEventPublisherPeerConnectionConnected, p.isPublisherConnected)
|
||||||
}
|
}
|
||||||
p.lock.Unlock()
|
p.lock.Unlock()
|
||||||
}
|
}
|
||||||
@@ -75,16 +95,18 @@ func (p *ParticipantSupervisor) AddPublication(trackID livekit.TrackID) {
|
|||||||
p.lock.Lock()
|
p.lock.Lock()
|
||||||
pm, ok := p.publications[trackID]
|
pm, ok := p.publications[trackID]
|
||||||
if !ok {
|
if !ok {
|
||||||
pm = NewPublicationMonitor(
|
pm = &trackMonitor{
|
||||||
|
opMon: NewPublicationMonitor(
|
||||||
PublicationMonitorParams{
|
PublicationMonitorParams{
|
||||||
TrackID: trackID,
|
TrackID: trackID,
|
||||||
IsPeerConnectionConnected: p.isPublisherConnected,
|
IsPeerConnectionConnected: p.isPublisherConnected,
|
||||||
Logger: p.params.Logger,
|
Logger: p.params.Logger,
|
||||||
},
|
},
|
||||||
)
|
),
|
||||||
|
}
|
||||||
p.publications[trackID] = pm
|
p.publications[trackID] = pm
|
||||||
}
|
}
|
||||||
pm.PostEvent(types.OperationMonitorEventAddPendingPublication, nil)
|
pm.opMon.PostEvent(types.OperationMonitorEventAddPendingPublication, nil)
|
||||||
p.lock.Unlock()
|
p.lock.Unlock()
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -92,7 +114,7 @@ func (p *ParticipantSupervisor) SetPublicationMute(trackID livekit.TrackID, isMu
|
|||||||
p.lock.Lock()
|
p.lock.Lock()
|
||||||
pm, ok := p.publications[trackID]
|
pm, ok := p.publications[trackID]
|
||||||
if ok {
|
if ok {
|
||||||
pm.PostEvent(types.OperationMonitorEventSetPublicationMute, isMuted)
|
pm.opMon.PostEvent(types.OperationMonitorEventSetPublicationMute, isMuted)
|
||||||
}
|
}
|
||||||
p.lock.Unlock()
|
p.lock.Unlock()
|
||||||
}
|
}
|
||||||
@@ -101,7 +123,7 @@ func (p *ParticipantSupervisor) SetPublishedTrack(trackID livekit.TrackID, pubTr
|
|||||||
p.lock.RLock()
|
p.lock.RLock()
|
||||||
pm, ok := p.publications[trackID]
|
pm, ok := p.publications[trackID]
|
||||||
if ok {
|
if ok {
|
||||||
pm.PostEvent(types.OperationMonitorEventSetPublishedTrack, pubTrack)
|
pm.opMon.PostEvent(types.OperationMonitorEventSetPublishedTrack, pubTrack)
|
||||||
}
|
}
|
||||||
p.lock.RUnlock()
|
p.lock.RUnlock()
|
||||||
}
|
}
|
||||||
@@ -110,36 +132,56 @@ func (p *ParticipantSupervisor) ClearPublishedTrack(trackID livekit.TrackID, pub
|
|||||||
p.lock.RLock()
|
p.lock.RLock()
|
||||||
pm, ok := p.publications[trackID]
|
pm, ok := p.publications[trackID]
|
||||||
if ok {
|
if ok {
|
||||||
pm.PostEvent(types.OperationMonitorEventClearPublishedTrack, pubTrack)
|
pm.opMon.PostEvent(types.OperationMonitorEventClearPublishedTrack, pubTrack)
|
||||||
}
|
}
|
||||||
p.lock.RUnlock()
|
p.lock.RUnlock()
|
||||||
}
|
}
|
||||||
|
|
||||||
func (p *ParticipantSupervisor) UpdateSubscription(trackID livekit.TrackID, isSubscribed bool) {
|
func (p *ParticipantSupervisor) UpdateSubscription(trackID livekit.TrackID, isSubscribe bool, sourceTrack types.MediaTrack) {
|
||||||
p.lock.Lock()
|
p.lock.Lock()
|
||||||
sm, ok := p.subscriptions[trackID]
|
sm, ok := p.subscriptions[trackID]
|
||||||
if !ok {
|
if !ok {
|
||||||
sm = NewSubscriptionMonitor(SubscriptionMonitorParams{TrackID: trackID, Logger: p.params.Logger})
|
sm = &trackMonitor{
|
||||||
|
opMon: NewSubscriptionMonitor(SubscriptionMonitorParams{TrackID: trackID, Logger: p.params.Logger}),
|
||||||
|
}
|
||||||
p.subscriptions[trackID] = sm
|
p.subscriptions[trackID] = sm
|
||||||
}
|
}
|
||||||
sm.PostEvent(types.OperationMonitorEventUpdateSubscription, isSubscribed)
|
sm.opMon.PostEvent(
|
||||||
|
types.OperationMonitorEventUpdateSubscription,
|
||||||
|
SubscriptionOpParams{
|
||||||
|
SourceTrack: sourceTrack,
|
||||||
|
IsSubscribe: isSubscribe,
|
||||||
|
},
|
||||||
|
)
|
||||||
p.lock.Unlock()
|
p.lock.Unlock()
|
||||||
}
|
}
|
||||||
|
|
||||||
func (p *ParticipantSupervisor) SetSubscribedTrack(trackID livekit.TrackID, subTrack types.SubscribedTrack) {
|
func (p *ParticipantSupervisor) SetSubscribedTrack(trackID livekit.TrackID, subTrack types.SubscribedTrack, sourceTrack types.MediaTrack) {
|
||||||
p.lock.RLock()
|
p.lock.RLock()
|
||||||
sm, ok := p.subscriptions[trackID]
|
sm, ok := p.subscriptions[trackID]
|
||||||
if ok {
|
if ok {
|
||||||
sm.PostEvent(types.OperationMonitorEventSetSubscribedTrack, subTrack)
|
sm.opMon.PostEvent(
|
||||||
|
types.OperationMonitorEventSetSubscribedTrack,
|
||||||
|
UpdateSubscribedTrackParams{
|
||||||
|
SourceTrack: sourceTrack,
|
||||||
|
SubscribedTrack: subTrack,
|
||||||
|
},
|
||||||
|
)
|
||||||
}
|
}
|
||||||
p.lock.RUnlock()
|
p.lock.RUnlock()
|
||||||
}
|
}
|
||||||
|
|
||||||
func (p *ParticipantSupervisor) ClearSubscribedTrack(trackID livekit.TrackID, subTrack types.SubscribedTrack) {
|
func (p *ParticipantSupervisor) ClearSubscribedTrack(trackID livekit.TrackID, subTrack types.SubscribedTrack, sourceTrack types.MediaTrack) {
|
||||||
p.lock.RLock()
|
p.lock.RLock()
|
||||||
sm, ok := p.subscriptions[trackID]
|
sm, ok := p.subscriptions[trackID]
|
||||||
if ok {
|
if ok {
|
||||||
sm.PostEvent(types.OperationMonitorEventClearSubscribedTrack, subTrack)
|
sm.opMon.PostEvent(
|
||||||
|
types.OperationMonitorEventClearSubscribedTrack,
|
||||||
|
UpdateSubscribedTrackParams{
|
||||||
|
SourceTrack: sourceTrack,
|
||||||
|
SubscribedTrack: subTrack,
|
||||||
|
},
|
||||||
|
)
|
||||||
}
|
}
|
||||||
p.lock.RUnlock()
|
p.lock.RUnlock()
|
||||||
}
|
}
|
||||||
@@ -161,11 +203,18 @@ func (p *ParticipantSupervisor) checkPublications() {
|
|||||||
var removablePublications []livekit.TrackID
|
var removablePublications []livekit.TrackID
|
||||||
p.lock.RLock()
|
p.lock.RLock()
|
||||||
for trackID, pm := range p.publications {
|
for trackID, pm := range p.publications {
|
||||||
if err := pm.Check(); err != nil {
|
if err := pm.opMon.Check(); err != nil {
|
||||||
|
if pm.err == nil {
|
||||||
p.params.Logger.Errorw("supervisor error on publication", err, "trackID", trackID)
|
p.params.Logger.Errorw("supervisor error on publication", err, "trackID", trackID)
|
||||||
|
pm.err = err
|
||||||
erroredPublications = append(erroredPublications, trackID)
|
erroredPublications = append(erroredPublications, trackID)
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
if pm.IsIdle() {
|
if pm.err != nil {
|
||||||
|
p.params.Logger.Infow("supervisor publication recovered", "trackID", trackID)
|
||||||
|
pm.err = err
|
||||||
|
}
|
||||||
|
if pm.opMon.IsIdle() {
|
||||||
removablePublications = append(removablePublications, trackID)
|
removablePublications = append(removablePublications, trackID)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -186,13 +235,22 @@ func (p *ParticipantSupervisor) checkPublications() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (p *ParticipantSupervisor) checkSubscriptions() {
|
func (p *ParticipantSupervisor) checkSubscriptions() {
|
||||||
|
var erroredSubscriptions []livekit.TrackID
|
||||||
var removableSubscriptions []livekit.TrackID
|
var removableSubscriptions []livekit.TrackID
|
||||||
p.lock.RLock()
|
p.lock.RLock()
|
||||||
for trackID, sm := range p.subscriptions {
|
for trackID, sm := range p.subscriptions {
|
||||||
if err := sm.Check(); err != nil {
|
if err := sm.opMon.Check(); err != nil {
|
||||||
|
if sm.err == nil {
|
||||||
p.params.Logger.Errorw("supervisor error on subscription", err, "trackID", trackID)
|
p.params.Logger.Errorw("supervisor error on subscription", err, "trackID", trackID)
|
||||||
|
sm.err = err
|
||||||
|
erroredSubscriptions = append(erroredSubscriptions, trackID)
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
if sm.IsIdle() {
|
if sm.err != nil {
|
||||||
|
p.params.Logger.Infow("supervisor subscription recovered", "trackID", trackID)
|
||||||
|
sm.err = err
|
||||||
|
}
|
||||||
|
if sm.opMon.IsIdle() {
|
||||||
removableSubscriptions = append(removableSubscriptions, trackID)
|
removableSubscriptions = append(removableSubscriptions, trackID)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -204,4 +262,10 @@ func (p *ParticipantSupervisor) checkSubscriptions() {
|
|||||||
delete(p.subscriptions, trackID)
|
delete(p.subscriptions, trackID)
|
||||||
}
|
}
|
||||||
p.lock.Unlock()
|
p.lock.Unlock()
|
||||||
|
|
||||||
|
if onSubscriptionError := p.getOnSubscriptionError(); onSubscriptionError != nil {
|
||||||
|
for _, trackID := range erroredSubscriptions {
|
||||||
|
onSubscriptionError(trackID)
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -40,8 +40,6 @@ type PublicationMonitor struct {
|
|||||||
publishedTrack types.LocalMediaTrack
|
publishedTrack types.LocalMediaTrack
|
||||||
isMuted bool
|
isMuted bool
|
||||||
unmutedAt time.Time
|
unmutedAt time.Time
|
||||||
|
|
||||||
lastError error
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func NewPublicationMonitor(params PublicationMonitorParams) *PublicationMonitor {
|
func NewPublicationMonitor(params PublicationMonitorParams) *PublicationMonitor {
|
||||||
@@ -118,7 +116,7 @@ func (p *PublicationMonitor) clearPublishedTrack(pubTrack types.LocalMediaTrack)
|
|||||||
if p.publishedTrack == pubTrack {
|
if p.publishedTrack == pubTrack {
|
||||||
p.publishedTrack = nil
|
p.publishedTrack = nil
|
||||||
} else {
|
} else {
|
||||||
p.params.Logger.Errorw("mismatched published track on clear", nil, "trackID", p.params.TrackID)
|
p.params.Logger.Errorw("supervisor: mismatched published track on clear", nil, "trackID", p.params.TrackID)
|
||||||
}
|
}
|
||||||
|
|
||||||
p.update()
|
p.update()
|
||||||
@@ -127,12 +125,6 @@ func (p *PublicationMonitor) clearPublishedTrack(pubTrack types.LocalMediaTrack)
|
|||||||
|
|
||||||
func (p *PublicationMonitor) Check() error {
|
func (p *PublicationMonitor) Check() error {
|
||||||
p.lock.RLock()
|
p.lock.RLock()
|
||||||
if p.lastError != nil {
|
|
||||||
p.lock.RUnlock()
|
|
||||||
// return an error only once
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
|
|
||||||
var pub *publish
|
var pub *publish
|
||||||
if p.desiredPublishes.Len() > 0 {
|
if p.desiredPublishes.Len() > 0 {
|
||||||
pub = p.desiredPublishes.Front().(*publish)
|
pub = p.desiredPublishes.Front().(*publish)
|
||||||
@@ -148,10 +140,6 @@ func (p *PublicationMonitor) Check() error {
|
|||||||
|
|
||||||
if pub.isStart && !isMuted && !unmutedAt.IsZero() && time.Since(unmutedAt) > publishWaitDuration {
|
if pub.isStart && !isMuted && !unmutedAt.IsZero() && time.Since(unmutedAt) > publishWaitDuration {
|
||||||
// timed out waiting for publish
|
// timed out waiting for publish
|
||||||
p.lock.Lock()
|
|
||||||
p.lastError = errPublishTimeout
|
|
||||||
p.lock.Unlock()
|
|
||||||
|
|
||||||
return errPublishTimeout
|
return errPublishTimeout
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -183,7 +171,5 @@ func (p *PublicationMonitor) update() {
|
|||||||
p.desiredPublishes.PushFront(pub)
|
p.desiredPublishes.PushFront(pub)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
p.lastError = nil
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
transitionWaitDuration = 10 * time.Second
|
transitionWaitDuration = 20 * time.Second
|
||||||
)
|
)
|
||||||
|
|
||||||
var (
|
var (
|
||||||
@@ -25,6 +25,22 @@ type transition struct {
|
|||||||
at time.Time
|
at time.Time
|
||||||
}
|
}
|
||||||
|
|
||||||
|
type subscriptionOps struct {
|
||||||
|
desiredTransitions deque.Deque
|
||||||
|
|
||||||
|
subscribedTrack types.SubscribedTrack
|
||||||
|
}
|
||||||
|
|
||||||
|
type SubscriptionOpParams struct {
|
||||||
|
SourceTrack types.MediaTrack
|
||||||
|
IsSubscribe bool
|
||||||
|
}
|
||||||
|
|
||||||
|
type UpdateSubscribedTrackParams struct {
|
||||||
|
SourceTrack types.MediaTrack
|
||||||
|
SubscribedTrack types.SubscribedTrack
|
||||||
|
}
|
||||||
|
|
||||||
type SubscriptionMonitorParams struct {
|
type SubscriptionMonitorParams struct {
|
||||||
TrackID livekit.TrackID
|
TrackID livekit.TrackID
|
||||||
Logger logger.Logger
|
Logger logger.Logger
|
||||||
@@ -34,37 +50,35 @@ type SubscriptionMonitor struct {
|
|||||||
params SubscriptionMonitorParams
|
params SubscriptionMonitorParams
|
||||||
|
|
||||||
lock sync.RWMutex
|
lock sync.RWMutex
|
||||||
desiredTransitions deque.Deque
|
subscriptionOpsBySource map[types.MediaTrack]*subscriptionOps
|
||||||
|
|
||||||
subscribedTrack types.SubscribedTrack
|
|
||||||
|
|
||||||
lastError error
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func NewSubscriptionMonitor(params SubscriptionMonitorParams) *SubscriptionMonitor {
|
func NewSubscriptionMonitor(params SubscriptionMonitorParams) *SubscriptionMonitor {
|
||||||
s := &SubscriptionMonitor{
|
s := &SubscriptionMonitor{
|
||||||
params: params,
|
params: params,
|
||||||
|
subscriptionOpsBySource: make(map[types.MediaTrack]*subscriptionOps),
|
||||||
}
|
}
|
||||||
s.desiredTransitions.SetMinCapacity(2)
|
|
||||||
return s
|
return s
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *SubscriptionMonitor) PostEvent(ome types.OperationMonitorEvent, omd types.OperationMonitorData) {
|
func (s *SubscriptionMonitor) PostEvent(ome types.OperationMonitorEvent, omd types.OperationMonitorData) {
|
||||||
switch ome {
|
switch ome {
|
||||||
case types.OperationMonitorEventUpdateSubscription:
|
case types.OperationMonitorEventUpdateSubscription:
|
||||||
s.updateSubscription(omd.(bool))
|
s.updateSubscription(omd.(SubscriptionOpParams))
|
||||||
case types.OperationMonitorEventSetSubscribedTrack:
|
case types.OperationMonitorEventSetSubscribedTrack:
|
||||||
s.setSubscribedTrack(omd.(types.SubscribedTrack))
|
s.setSubscribedTrack(omd.(UpdateSubscribedTrackParams))
|
||||||
case types.OperationMonitorEventClearSubscribedTrack:
|
case types.OperationMonitorEventClearSubscribedTrack:
|
||||||
s.clearSubscribedTrack(omd.(types.SubscribedTrack))
|
s.clearSubscribedTrack(omd.(UpdateSubscribedTrackParams))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *SubscriptionMonitor) updateSubscription(isSubscribe bool) {
|
func (s *SubscriptionMonitor) updateSubscription(params SubscriptionOpParams) {
|
||||||
s.lock.Lock()
|
s.lock.Lock()
|
||||||
s.desiredTransitions.PushBack(
|
|
||||||
|
so := s.getOrCreateSubscriptionOpsForSource(params.SourceTrack)
|
||||||
|
so.desiredTransitions.PushBack(
|
||||||
&transition{
|
&transition{
|
||||||
isSubscribe: isSubscribe,
|
isSubscribe: params.IsSubscribe,
|
||||||
at: time.Now(),
|
at: time.Now(),
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
@@ -72,19 +86,21 @@ func (s *SubscriptionMonitor) updateSubscription(isSubscribe bool) {
|
|||||||
s.lock.Unlock()
|
s.lock.Unlock()
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *SubscriptionMonitor) setSubscribedTrack(subTrack types.SubscribedTrack) {
|
func (s *SubscriptionMonitor) setSubscribedTrack(params UpdateSubscribedTrackParams) {
|
||||||
s.lock.Lock()
|
s.lock.Lock()
|
||||||
s.subscribedTrack = subTrack
|
so := s.getOrCreateSubscriptionOpsForSource(params.SourceTrack)
|
||||||
|
so.subscribedTrack = params.SubscribedTrack
|
||||||
s.update()
|
s.update()
|
||||||
s.lock.Unlock()
|
s.lock.Unlock()
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *SubscriptionMonitor) clearSubscribedTrack(subTrack types.SubscribedTrack) {
|
func (s *SubscriptionMonitor) clearSubscribedTrack(params UpdateSubscribedTrackParams) {
|
||||||
s.lock.Lock()
|
s.lock.Lock()
|
||||||
if s.subscribedTrack == subTrack {
|
so := s.getOrCreateSubscriptionOpsForSource(params.SourceTrack)
|
||||||
s.subscribedTrack = nil
|
if so.subscribedTrack == params.SubscribedTrack {
|
||||||
|
so.subscribedTrack = nil
|
||||||
} else {
|
} else {
|
||||||
s.params.Logger.Errorw("mismatched subscribed track on clear", nil, "trackID", s.params.TrackID)
|
s.params.Logger.Errorw("supervisor: mismatched subscribed track on clear", nil, "trackID", s.params.TrackID)
|
||||||
}
|
}
|
||||||
|
|
||||||
s.update()
|
s.update()
|
||||||
@@ -92,37 +108,27 @@ func (s *SubscriptionMonitor) clearSubscribedTrack(subTrack types.SubscribedTrac
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (s *SubscriptionMonitor) Check() error {
|
func (s *SubscriptionMonitor) Check() error {
|
||||||
s.lock.RLock()
|
s.lock.Lock()
|
||||||
if s.lastError != nil {
|
defer s.lock.Unlock()
|
||||||
s.lock.RUnlock()
|
|
||||||
// return an error only once
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
|
|
||||||
|
for _, so := range s.subscriptionOpsBySource {
|
||||||
var tx *transition
|
var tx *transition
|
||||||
if s.desiredTransitions.Len() > 0 {
|
if so.desiredTransitions.Len() > 0 {
|
||||||
tx = s.desiredTransitions.Front().(*transition)
|
tx = so.desiredTransitions.Front().(*transition)
|
||||||
}
|
}
|
||||||
s.lock.RUnlock()
|
|
||||||
|
|
||||||
if tx == nil {
|
if tx == nil {
|
||||||
return nil
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
if time.Since(tx.at) > transitionWaitDuration {
|
if time.Since(tx.at) > transitionWaitDuration {
|
||||||
// timed out waiting for transition
|
// timed out waiting for transition
|
||||||
var err error
|
|
||||||
if tx.isSubscribe {
|
if tx.isSubscribe {
|
||||||
err = errSubscribeTimeout
|
return errSubscribeTimeout
|
||||||
} else {
|
} else {
|
||||||
err = errUnsubscribeTimeout
|
return errUnsubscribeTimeout
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
s.lock.Lock()
|
|
||||||
s.lastError = err
|
|
||||||
s.lock.Unlock()
|
|
||||||
|
|
||||||
return err
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// give more time for transition to happen
|
// give more time for transition to happen
|
||||||
@@ -133,26 +139,41 @@ func (s *SubscriptionMonitor) IsIdle() bool {
|
|||||||
s.lock.RLock()
|
s.lock.RLock()
|
||||||
defer s.lock.RUnlock()
|
defer s.lock.RUnlock()
|
||||||
|
|
||||||
return s.desiredTransitions.Len() == 0 && s.subscribedTrack == nil
|
return len(s.subscriptionOpsBySource) == 0
|
||||||
|
}
|
||||||
|
|
||||||
|
func (s *SubscriptionMonitor) getOrCreateSubscriptionOpsForSource(sourceTrack types.MediaTrack) *subscriptionOps {
|
||||||
|
so := s.subscriptionOpsBySource[sourceTrack]
|
||||||
|
if so == nil {
|
||||||
|
so = &subscriptionOps{}
|
||||||
|
so.desiredTransitions.SetMinCapacity(4)
|
||||||
|
s.subscriptionOpsBySource[sourceTrack] = so
|
||||||
|
}
|
||||||
|
|
||||||
|
return so
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *SubscriptionMonitor) update() {
|
func (s *SubscriptionMonitor) update() {
|
||||||
|
for sourceTrack, so := range s.subscriptionOpsBySource {
|
||||||
for {
|
for {
|
||||||
var tx *transition
|
var tx *transition
|
||||||
if s.desiredTransitions.Len() > 0 {
|
if so.desiredTransitions.Len() > 0 {
|
||||||
tx = s.desiredTransitions.PopFront().(*transition)
|
tx = so.desiredTransitions.PopFront().(*transition)
|
||||||
}
|
}
|
||||||
|
|
||||||
if tx == nil {
|
if tx == nil {
|
||||||
return
|
break
|
||||||
}
|
}
|
||||||
|
|
||||||
if (tx.isSubscribe && s.subscribedTrack == nil) || (!tx.isSubscribe && s.subscribedTrack != nil) {
|
if (tx.isSubscribe && so.subscribedTrack == nil) || (!tx.isSubscribe && so.subscribedTrack != nil) {
|
||||||
// put it back as the condition is not satisfied
|
// put it back as the condition is not satisfied
|
||||||
s.desiredTransitions.PushFront(tx)
|
so.desiredTransitions.PushFront(tx)
|
||||||
return
|
break
|
||||||
}
|
}
|
||||||
|
|
||||||
s.lastError = nil
|
if so.desiredTransitions.Len() == 0 && so.subscribedTrack == nil {
|
||||||
|
delete(s.subscriptionOpsBySource, sourceTrack)
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -262,8 +262,8 @@ type LocalParticipant interface {
|
|||||||
RemoveTrackFromSubscriber(sender *webrtc.RTPSender) error
|
RemoveTrackFromSubscriber(sender *webrtc.RTPSender) error
|
||||||
|
|
||||||
// subscriptions
|
// subscriptions
|
||||||
AddSubscribedTrack(st SubscribedTrack)
|
AddSubscribedTrack(st SubscribedTrack, sourceTrack MediaTrack)
|
||||||
RemoveSubscribedTrack(st SubscribedTrack)
|
RemoveSubscribedTrack(st SubscribedTrack, sourceTrack MediaTrack)
|
||||||
UpdateSubscribedTrackSettings(trackID livekit.TrackID, settings *livekit.UpdateTrackSettings) error
|
UpdateSubscribedTrackSettings(trackID livekit.TrackID, settings *livekit.UpdateTrackSettings) error
|
||||||
GetSubscribedTracks() []SubscribedTrack
|
GetSubscribedTracks() []SubscribedTrack
|
||||||
VerifySubscribeParticipantInfo(pID livekit.ParticipantID, version uint32)
|
VerifySubscribeParticipantInfo(pID livekit.ParticipantID, version uint32)
|
||||||
@@ -312,9 +312,10 @@ type LocalParticipant interface {
|
|||||||
UncacheDownTrack(rtpTransceiver *webrtc.RTPTransceiver)
|
UncacheDownTrack(rtpTransceiver *webrtc.RTPTransceiver)
|
||||||
GetCachedDownTrack(trackID livekit.TrackID) (*webrtc.RTPTransceiver, sfu.DownTrackState)
|
GetCachedDownTrack(trackID livekit.TrackID) (*webrtc.RTPTransceiver, sfu.DownTrackState)
|
||||||
|
|
||||||
EnqueueSubscribeTrack(trackID livekit.TrackID, isRelayed bool, f func(sub LocalParticipant) error) bool
|
EnqueueSubscribeTrack(trackID livekit.TrackID, sourceTrack MediaTrack, isRelayed bool, f func(sub LocalParticipant) error) bool
|
||||||
EnqueueUnsubscribeTrack(
|
EnqueueUnsubscribeTrack(
|
||||||
trackID livekit.TrackID,
|
trackID livekit.TrackID,
|
||||||
|
sourceTrack MediaTrack,
|
||||||
isRelayed bool,
|
isRelayed bool,
|
||||||
willBeResumed bool,
|
willBeResumed bool,
|
||||||
f func(subscriberID livekit.ParticipantID, willBeResumed bool) error,
|
f func(subscriberID livekit.ParticipantID, willBeResumed bool) error,
|
||||||
|
|||||||
@@ -23,10 +23,11 @@ type FakeLocalParticipant struct {
|
|||||||
arg1 webrtc.ICECandidateInit
|
arg1 webrtc.ICECandidateInit
|
||||||
arg2 livekit.SignalTarget
|
arg2 livekit.SignalTarget
|
||||||
}
|
}
|
||||||
AddSubscribedTrackStub func(types.SubscribedTrack)
|
AddSubscribedTrackStub func(types.SubscribedTrack, types.MediaTrack)
|
||||||
addSubscribedTrackMutex sync.RWMutex
|
addSubscribedTrackMutex sync.RWMutex
|
||||||
addSubscribedTrackArgsForCall []struct {
|
addSubscribedTrackArgsForCall []struct {
|
||||||
arg1 types.SubscribedTrack
|
arg1 types.SubscribedTrack
|
||||||
|
arg2 types.MediaTrack
|
||||||
}
|
}
|
||||||
AddSubscriberStub func(types.LocalParticipant, types.AddSubscriberParams) (int, error)
|
AddSubscriberStub func(types.LocalParticipant, types.AddSubscriberParams) (int, error)
|
||||||
addSubscriberMutex sync.RWMutex
|
addSubscriberMutex sync.RWMutex
|
||||||
@@ -167,12 +168,13 @@ type FakeLocalParticipant struct {
|
|||||||
debugInfoReturnsOnCall map[int]struct {
|
debugInfoReturnsOnCall map[int]struct {
|
||||||
result1 map[string]interface{}
|
result1 map[string]interface{}
|
||||||
}
|
}
|
||||||
EnqueueSubscribeTrackStub func(livekit.TrackID, bool, func(sub types.LocalParticipant) error) bool
|
EnqueueSubscribeTrackStub func(livekit.TrackID, types.MediaTrack, bool, func(sub types.LocalParticipant) error) bool
|
||||||
enqueueSubscribeTrackMutex sync.RWMutex
|
enqueueSubscribeTrackMutex sync.RWMutex
|
||||||
enqueueSubscribeTrackArgsForCall []struct {
|
enqueueSubscribeTrackArgsForCall []struct {
|
||||||
arg1 livekit.TrackID
|
arg1 livekit.TrackID
|
||||||
arg2 bool
|
arg2 types.MediaTrack
|
||||||
arg3 func(sub types.LocalParticipant) error
|
arg3 bool
|
||||||
|
arg4 func(sub types.LocalParticipant) error
|
||||||
}
|
}
|
||||||
enqueueSubscribeTrackReturns struct {
|
enqueueSubscribeTrackReturns struct {
|
||||||
result1 bool
|
result1 bool
|
||||||
@@ -180,13 +182,14 @@ type FakeLocalParticipant struct {
|
|||||||
enqueueSubscribeTrackReturnsOnCall map[int]struct {
|
enqueueSubscribeTrackReturnsOnCall map[int]struct {
|
||||||
result1 bool
|
result1 bool
|
||||||
}
|
}
|
||||||
EnqueueUnsubscribeTrackStub func(livekit.TrackID, bool, bool, func(subscriberID livekit.ParticipantID, willBeResumed bool) error) bool
|
EnqueueUnsubscribeTrackStub func(livekit.TrackID, types.MediaTrack, bool, bool, func(subscriberID livekit.ParticipantID, willBeResumed bool) error) bool
|
||||||
enqueueUnsubscribeTrackMutex sync.RWMutex
|
enqueueUnsubscribeTrackMutex sync.RWMutex
|
||||||
enqueueUnsubscribeTrackArgsForCall []struct {
|
enqueueUnsubscribeTrackArgsForCall []struct {
|
||||||
arg1 livekit.TrackID
|
arg1 livekit.TrackID
|
||||||
arg2 bool
|
arg2 types.MediaTrack
|
||||||
arg3 bool
|
arg3 bool
|
||||||
arg4 func(subscriberID livekit.ParticipantID, willBeResumed bool) error
|
arg4 bool
|
||||||
|
arg5 func(subscriberID livekit.ParticipantID, willBeResumed bool) error
|
||||||
}
|
}
|
||||||
enqueueUnsubscribeTrackReturns struct {
|
enqueueUnsubscribeTrackReturns struct {
|
||||||
result1 bool
|
result1 bool
|
||||||
@@ -506,10 +509,11 @@ type FakeLocalParticipant struct {
|
|||||||
arg2 bool
|
arg2 bool
|
||||||
arg3 bool
|
arg3 bool
|
||||||
}
|
}
|
||||||
RemoveSubscribedTrackStub func(types.SubscribedTrack)
|
RemoveSubscribedTrackStub func(types.SubscribedTrack, types.MediaTrack)
|
||||||
removeSubscribedTrackMutex sync.RWMutex
|
removeSubscribedTrackMutex sync.RWMutex
|
||||||
removeSubscribedTrackArgsForCall []struct {
|
removeSubscribedTrackArgsForCall []struct {
|
||||||
arg1 types.SubscribedTrack
|
arg1 types.SubscribedTrack
|
||||||
|
arg2 types.MediaTrack
|
||||||
}
|
}
|
||||||
RemoveSubscriberStub func(types.LocalParticipant, livekit.TrackID, bool)
|
RemoveSubscriberStub func(types.LocalParticipant, livekit.TrackID, bool)
|
||||||
removeSubscriberMutex sync.RWMutex
|
removeSubscriberMutex sync.RWMutex
|
||||||
@@ -827,16 +831,17 @@ func (fake *FakeLocalParticipant) AddICECandidateArgsForCall(i int) (webrtc.ICEC
|
|||||||
return argsForCall.arg1, argsForCall.arg2
|
return argsForCall.arg1, argsForCall.arg2
|
||||||
}
|
}
|
||||||
|
|
||||||
func (fake *FakeLocalParticipant) AddSubscribedTrack(arg1 types.SubscribedTrack) {
|
func (fake *FakeLocalParticipant) AddSubscribedTrack(arg1 types.SubscribedTrack, arg2 types.MediaTrack) {
|
||||||
fake.addSubscribedTrackMutex.Lock()
|
fake.addSubscribedTrackMutex.Lock()
|
||||||
fake.addSubscribedTrackArgsForCall = append(fake.addSubscribedTrackArgsForCall, struct {
|
fake.addSubscribedTrackArgsForCall = append(fake.addSubscribedTrackArgsForCall, struct {
|
||||||
arg1 types.SubscribedTrack
|
arg1 types.SubscribedTrack
|
||||||
}{arg1})
|
arg2 types.MediaTrack
|
||||||
|
}{arg1, arg2})
|
||||||
stub := fake.AddSubscribedTrackStub
|
stub := fake.AddSubscribedTrackStub
|
||||||
fake.recordInvocation("AddSubscribedTrack", []interface{}{arg1})
|
fake.recordInvocation("AddSubscribedTrack", []interface{}{arg1, arg2})
|
||||||
fake.addSubscribedTrackMutex.Unlock()
|
fake.addSubscribedTrackMutex.Unlock()
|
||||||
if stub != nil {
|
if stub != nil {
|
||||||
fake.AddSubscribedTrackStub(arg1)
|
fake.AddSubscribedTrackStub(arg1, arg2)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -846,17 +851,17 @@ func (fake *FakeLocalParticipant) AddSubscribedTrackCallCount() int {
|
|||||||
return len(fake.addSubscribedTrackArgsForCall)
|
return len(fake.addSubscribedTrackArgsForCall)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (fake *FakeLocalParticipant) AddSubscribedTrackCalls(stub func(types.SubscribedTrack)) {
|
func (fake *FakeLocalParticipant) AddSubscribedTrackCalls(stub func(types.SubscribedTrack, types.MediaTrack)) {
|
||||||
fake.addSubscribedTrackMutex.Lock()
|
fake.addSubscribedTrackMutex.Lock()
|
||||||
defer fake.addSubscribedTrackMutex.Unlock()
|
defer fake.addSubscribedTrackMutex.Unlock()
|
||||||
fake.AddSubscribedTrackStub = stub
|
fake.AddSubscribedTrackStub = stub
|
||||||
}
|
}
|
||||||
|
|
||||||
func (fake *FakeLocalParticipant) AddSubscribedTrackArgsForCall(i int) types.SubscribedTrack {
|
func (fake *FakeLocalParticipant) AddSubscribedTrackArgsForCall(i int) (types.SubscribedTrack, types.MediaTrack) {
|
||||||
fake.addSubscribedTrackMutex.RLock()
|
fake.addSubscribedTrackMutex.RLock()
|
||||||
defer fake.addSubscribedTrackMutex.RUnlock()
|
defer fake.addSubscribedTrackMutex.RUnlock()
|
||||||
argsForCall := fake.addSubscribedTrackArgsForCall[i]
|
argsForCall := fake.addSubscribedTrackArgsForCall[i]
|
||||||
return argsForCall.arg1
|
return argsForCall.arg1, argsForCall.arg2
|
||||||
}
|
}
|
||||||
|
|
||||||
func (fake *FakeLocalParticipant) AddSubscriber(arg1 types.LocalParticipant, arg2 types.AddSubscriberParams) (int, error) {
|
func (fake *FakeLocalParticipant) AddSubscriber(arg1 types.LocalParticipant, arg2 types.AddSubscriberParams) (int, error) {
|
||||||
@@ -1562,20 +1567,21 @@ func (fake *FakeLocalParticipant) DebugInfoReturnsOnCall(i int, result1 map[stri
|
|||||||
}{result1}
|
}{result1}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (fake *FakeLocalParticipant) EnqueueSubscribeTrack(arg1 livekit.TrackID, arg2 bool, arg3 func(sub types.LocalParticipant) error) bool {
|
func (fake *FakeLocalParticipant) EnqueueSubscribeTrack(arg1 livekit.TrackID, arg2 types.MediaTrack, arg3 bool, arg4 func(sub types.LocalParticipant) error) bool {
|
||||||
fake.enqueueSubscribeTrackMutex.Lock()
|
fake.enqueueSubscribeTrackMutex.Lock()
|
||||||
ret, specificReturn := fake.enqueueSubscribeTrackReturnsOnCall[len(fake.enqueueSubscribeTrackArgsForCall)]
|
ret, specificReturn := fake.enqueueSubscribeTrackReturnsOnCall[len(fake.enqueueSubscribeTrackArgsForCall)]
|
||||||
fake.enqueueSubscribeTrackArgsForCall = append(fake.enqueueSubscribeTrackArgsForCall, struct {
|
fake.enqueueSubscribeTrackArgsForCall = append(fake.enqueueSubscribeTrackArgsForCall, struct {
|
||||||
arg1 livekit.TrackID
|
arg1 livekit.TrackID
|
||||||
arg2 bool
|
arg2 types.MediaTrack
|
||||||
arg3 func(sub types.LocalParticipant) error
|
arg3 bool
|
||||||
}{arg1, arg2, arg3})
|
arg4 func(sub types.LocalParticipant) error
|
||||||
|
}{arg1, arg2, arg3, arg4})
|
||||||
stub := fake.EnqueueSubscribeTrackStub
|
stub := fake.EnqueueSubscribeTrackStub
|
||||||
fakeReturns := fake.enqueueSubscribeTrackReturns
|
fakeReturns := fake.enqueueSubscribeTrackReturns
|
||||||
fake.recordInvocation("EnqueueSubscribeTrack", []interface{}{arg1, arg2, arg3})
|
fake.recordInvocation("EnqueueSubscribeTrack", []interface{}{arg1, arg2, arg3, arg4})
|
||||||
fake.enqueueSubscribeTrackMutex.Unlock()
|
fake.enqueueSubscribeTrackMutex.Unlock()
|
||||||
if stub != nil {
|
if stub != nil {
|
||||||
return stub(arg1, arg2, arg3)
|
return stub(arg1, arg2, arg3, arg4)
|
||||||
}
|
}
|
||||||
if specificReturn {
|
if specificReturn {
|
||||||
return ret.result1
|
return ret.result1
|
||||||
@@ -1589,17 +1595,17 @@ func (fake *FakeLocalParticipant) EnqueueSubscribeTrackCallCount() int {
|
|||||||
return len(fake.enqueueSubscribeTrackArgsForCall)
|
return len(fake.enqueueSubscribeTrackArgsForCall)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (fake *FakeLocalParticipant) EnqueueSubscribeTrackCalls(stub func(livekit.TrackID, bool, func(sub types.LocalParticipant) error) bool) {
|
func (fake *FakeLocalParticipant) EnqueueSubscribeTrackCalls(stub func(livekit.TrackID, types.MediaTrack, bool, func(sub types.LocalParticipant) error) bool) {
|
||||||
fake.enqueueSubscribeTrackMutex.Lock()
|
fake.enqueueSubscribeTrackMutex.Lock()
|
||||||
defer fake.enqueueSubscribeTrackMutex.Unlock()
|
defer fake.enqueueSubscribeTrackMutex.Unlock()
|
||||||
fake.EnqueueSubscribeTrackStub = stub
|
fake.EnqueueSubscribeTrackStub = stub
|
||||||
}
|
}
|
||||||
|
|
||||||
func (fake *FakeLocalParticipant) EnqueueSubscribeTrackArgsForCall(i int) (livekit.TrackID, bool, func(sub types.LocalParticipant) error) {
|
func (fake *FakeLocalParticipant) EnqueueSubscribeTrackArgsForCall(i int) (livekit.TrackID, types.MediaTrack, bool, func(sub types.LocalParticipant) error) {
|
||||||
fake.enqueueSubscribeTrackMutex.RLock()
|
fake.enqueueSubscribeTrackMutex.RLock()
|
||||||
defer fake.enqueueSubscribeTrackMutex.RUnlock()
|
defer fake.enqueueSubscribeTrackMutex.RUnlock()
|
||||||
argsForCall := fake.enqueueSubscribeTrackArgsForCall[i]
|
argsForCall := fake.enqueueSubscribeTrackArgsForCall[i]
|
||||||
return argsForCall.arg1, argsForCall.arg2, argsForCall.arg3
|
return argsForCall.arg1, argsForCall.arg2, argsForCall.arg3, argsForCall.arg4
|
||||||
}
|
}
|
||||||
|
|
||||||
func (fake *FakeLocalParticipant) EnqueueSubscribeTrackReturns(result1 bool) {
|
func (fake *FakeLocalParticipant) EnqueueSubscribeTrackReturns(result1 bool) {
|
||||||
@@ -1625,21 +1631,22 @@ func (fake *FakeLocalParticipant) EnqueueSubscribeTrackReturnsOnCall(i int, resu
|
|||||||
}{result1}
|
}{result1}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (fake *FakeLocalParticipant) EnqueueUnsubscribeTrack(arg1 livekit.TrackID, arg2 bool, arg3 bool, arg4 func(subscriberID livekit.ParticipantID, willBeResumed bool) error) bool {
|
func (fake *FakeLocalParticipant) EnqueueUnsubscribeTrack(arg1 livekit.TrackID, arg2 types.MediaTrack, arg3 bool, arg4 bool, arg5 func(subscriberID livekit.ParticipantID, willBeResumed bool) error) bool {
|
||||||
fake.enqueueUnsubscribeTrackMutex.Lock()
|
fake.enqueueUnsubscribeTrackMutex.Lock()
|
||||||
ret, specificReturn := fake.enqueueUnsubscribeTrackReturnsOnCall[len(fake.enqueueUnsubscribeTrackArgsForCall)]
|
ret, specificReturn := fake.enqueueUnsubscribeTrackReturnsOnCall[len(fake.enqueueUnsubscribeTrackArgsForCall)]
|
||||||
fake.enqueueUnsubscribeTrackArgsForCall = append(fake.enqueueUnsubscribeTrackArgsForCall, struct {
|
fake.enqueueUnsubscribeTrackArgsForCall = append(fake.enqueueUnsubscribeTrackArgsForCall, struct {
|
||||||
arg1 livekit.TrackID
|
arg1 livekit.TrackID
|
||||||
arg2 bool
|
arg2 types.MediaTrack
|
||||||
arg3 bool
|
arg3 bool
|
||||||
arg4 func(subscriberID livekit.ParticipantID, willBeResumed bool) error
|
arg4 bool
|
||||||
}{arg1, arg2, arg3, arg4})
|
arg5 func(subscriberID livekit.ParticipantID, willBeResumed bool) error
|
||||||
|
}{arg1, arg2, arg3, arg4, arg5})
|
||||||
stub := fake.EnqueueUnsubscribeTrackStub
|
stub := fake.EnqueueUnsubscribeTrackStub
|
||||||
fakeReturns := fake.enqueueUnsubscribeTrackReturns
|
fakeReturns := fake.enqueueUnsubscribeTrackReturns
|
||||||
fake.recordInvocation("EnqueueUnsubscribeTrack", []interface{}{arg1, arg2, arg3, arg4})
|
fake.recordInvocation("EnqueueUnsubscribeTrack", []interface{}{arg1, arg2, arg3, arg4, arg5})
|
||||||
fake.enqueueUnsubscribeTrackMutex.Unlock()
|
fake.enqueueUnsubscribeTrackMutex.Unlock()
|
||||||
if stub != nil {
|
if stub != nil {
|
||||||
return stub(arg1, arg2, arg3, arg4)
|
return stub(arg1, arg2, arg3, arg4, arg5)
|
||||||
}
|
}
|
||||||
if specificReturn {
|
if specificReturn {
|
||||||
return ret.result1
|
return ret.result1
|
||||||
@@ -1653,17 +1660,17 @@ func (fake *FakeLocalParticipant) EnqueueUnsubscribeTrackCallCount() int {
|
|||||||
return len(fake.enqueueUnsubscribeTrackArgsForCall)
|
return len(fake.enqueueUnsubscribeTrackArgsForCall)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (fake *FakeLocalParticipant) EnqueueUnsubscribeTrackCalls(stub func(livekit.TrackID, bool, bool, func(subscriberID livekit.ParticipantID, willBeResumed bool) error) bool) {
|
func (fake *FakeLocalParticipant) EnqueueUnsubscribeTrackCalls(stub func(livekit.TrackID, types.MediaTrack, bool, bool, func(subscriberID livekit.ParticipantID, willBeResumed bool) error) bool) {
|
||||||
fake.enqueueUnsubscribeTrackMutex.Lock()
|
fake.enqueueUnsubscribeTrackMutex.Lock()
|
||||||
defer fake.enqueueUnsubscribeTrackMutex.Unlock()
|
defer fake.enqueueUnsubscribeTrackMutex.Unlock()
|
||||||
fake.EnqueueUnsubscribeTrackStub = stub
|
fake.EnqueueUnsubscribeTrackStub = stub
|
||||||
}
|
}
|
||||||
|
|
||||||
func (fake *FakeLocalParticipant) EnqueueUnsubscribeTrackArgsForCall(i int) (livekit.TrackID, bool, bool, func(subscriberID livekit.ParticipantID, willBeResumed bool) error) {
|
func (fake *FakeLocalParticipant) EnqueueUnsubscribeTrackArgsForCall(i int) (livekit.TrackID, types.MediaTrack, bool, bool, func(subscriberID livekit.ParticipantID, willBeResumed bool) error) {
|
||||||
fake.enqueueUnsubscribeTrackMutex.RLock()
|
fake.enqueueUnsubscribeTrackMutex.RLock()
|
||||||
defer fake.enqueueUnsubscribeTrackMutex.RUnlock()
|
defer fake.enqueueUnsubscribeTrackMutex.RUnlock()
|
||||||
argsForCall := fake.enqueueUnsubscribeTrackArgsForCall[i]
|
argsForCall := fake.enqueueUnsubscribeTrackArgsForCall[i]
|
||||||
return argsForCall.arg1, argsForCall.arg2, argsForCall.arg3, argsForCall.arg4
|
return argsForCall.arg1, argsForCall.arg2, argsForCall.arg3, argsForCall.arg4, argsForCall.arg5
|
||||||
}
|
}
|
||||||
|
|
||||||
func (fake *FakeLocalParticipant) EnqueueUnsubscribeTrackReturns(result1 bool) {
|
func (fake *FakeLocalParticipant) EnqueueUnsubscribeTrackReturns(result1 bool) {
|
||||||
@@ -3409,16 +3416,17 @@ func (fake *FakeLocalParticipant) RemovePublishedTrackArgsForCall(i int) (types.
|
|||||||
return argsForCall.arg1, argsForCall.arg2, argsForCall.arg3
|
return argsForCall.arg1, argsForCall.arg2, argsForCall.arg3
|
||||||
}
|
}
|
||||||
|
|
||||||
func (fake *FakeLocalParticipant) RemoveSubscribedTrack(arg1 types.SubscribedTrack) {
|
func (fake *FakeLocalParticipant) RemoveSubscribedTrack(arg1 types.SubscribedTrack, arg2 types.MediaTrack) {
|
||||||
fake.removeSubscribedTrackMutex.Lock()
|
fake.removeSubscribedTrackMutex.Lock()
|
||||||
fake.removeSubscribedTrackArgsForCall = append(fake.removeSubscribedTrackArgsForCall, struct {
|
fake.removeSubscribedTrackArgsForCall = append(fake.removeSubscribedTrackArgsForCall, struct {
|
||||||
arg1 types.SubscribedTrack
|
arg1 types.SubscribedTrack
|
||||||
}{arg1})
|
arg2 types.MediaTrack
|
||||||
|
}{arg1, arg2})
|
||||||
stub := fake.RemoveSubscribedTrackStub
|
stub := fake.RemoveSubscribedTrackStub
|
||||||
fake.recordInvocation("RemoveSubscribedTrack", []interface{}{arg1})
|
fake.recordInvocation("RemoveSubscribedTrack", []interface{}{arg1, arg2})
|
||||||
fake.removeSubscribedTrackMutex.Unlock()
|
fake.removeSubscribedTrackMutex.Unlock()
|
||||||
if stub != nil {
|
if stub != nil {
|
||||||
fake.RemoveSubscribedTrackStub(arg1)
|
fake.RemoveSubscribedTrackStub(arg1, arg2)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -3428,17 +3436,17 @@ func (fake *FakeLocalParticipant) RemoveSubscribedTrackCallCount() int {
|
|||||||
return len(fake.removeSubscribedTrackArgsForCall)
|
return len(fake.removeSubscribedTrackArgsForCall)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (fake *FakeLocalParticipant) RemoveSubscribedTrackCalls(stub func(types.SubscribedTrack)) {
|
func (fake *FakeLocalParticipant) RemoveSubscribedTrackCalls(stub func(types.SubscribedTrack, types.MediaTrack)) {
|
||||||
fake.removeSubscribedTrackMutex.Lock()
|
fake.removeSubscribedTrackMutex.Lock()
|
||||||
defer fake.removeSubscribedTrackMutex.Unlock()
|
defer fake.removeSubscribedTrackMutex.Unlock()
|
||||||
fake.RemoveSubscribedTrackStub = stub
|
fake.RemoveSubscribedTrackStub = stub
|
||||||
}
|
}
|
||||||
|
|
||||||
func (fake *FakeLocalParticipant) RemoveSubscribedTrackArgsForCall(i int) types.SubscribedTrack {
|
func (fake *FakeLocalParticipant) RemoveSubscribedTrackArgsForCall(i int) (types.SubscribedTrack, types.MediaTrack) {
|
||||||
fake.removeSubscribedTrackMutex.RLock()
|
fake.removeSubscribedTrackMutex.RLock()
|
||||||
defer fake.removeSubscribedTrackMutex.RUnlock()
|
defer fake.removeSubscribedTrackMutex.RUnlock()
|
||||||
argsForCall := fake.removeSubscribedTrackArgsForCall[i]
|
argsForCall := fake.removeSubscribedTrackArgsForCall[i]
|
||||||
return argsForCall.arg1
|
return argsForCall.arg1, argsForCall.arg2
|
||||||
}
|
}
|
||||||
|
|
||||||
func (fake *FakeLocalParticipant) RemoveSubscriber(arg1 types.LocalParticipant, arg2 livekit.TrackID, arg3 bool) {
|
func (fake *FakeLocalParticipant) RemoveSubscriber(arg1 types.LocalParticipant, arg2 livekit.TrackID, arg3 bool) {
|
||||||
|
|||||||
@@ -285,6 +285,11 @@ func (r *RoomManager) StartSession(
|
|||||||
if r.config.RTC.ReconnectOnPublicationError != nil {
|
if r.config.RTC.ReconnectOnPublicationError != nil {
|
||||||
reconnectOnPublicationError = *r.config.RTC.ReconnectOnPublicationError
|
reconnectOnPublicationError = *r.config.RTC.ReconnectOnPublicationError
|
||||||
}
|
}
|
||||||
|
// default do not force full reconnect on a subscription error
|
||||||
|
reconnectOnSubscriptionError := false
|
||||||
|
if r.config.RTC.ReconnectOnSubscriptionError != nil {
|
||||||
|
reconnectOnSubscriptionError = *r.config.RTC.ReconnectOnSubscriptionError
|
||||||
|
}
|
||||||
participant, err = rtc.NewParticipant(rtc.ParticipantParams{
|
participant, err = rtc.NewParticipant(rtc.ParticipantParams{
|
||||||
Identity: pi.Identity,
|
Identity: pi.Identity,
|
||||||
Name: pi.Name,
|
Name: pi.Name,
|
||||||
@@ -313,6 +318,7 @@ func (r *RoomManager) StartSession(
|
|||||||
return nil
|
return nil
|
||||||
},
|
},
|
||||||
ReconnectOnPublicationError: reconnectOnPublicationError,
|
ReconnectOnPublicationError: reconnectOnPublicationError,
|
||||||
|
ReconnectOnSubscriptionError: reconnectOnSubscriptionError,
|
||||||
})
|
})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
|
|||||||
Reference in New Issue
Block a user