feat: add stop reason

This commit is contained in:
langhuihui
2023-08-06 15:09:20 +08:00
parent 261851f7f7
commit d39958089a
5 changed files with 39 additions and 34 deletions

View File

@@ -6,6 +6,7 @@ import (
"github.com/pion/rtcp"
. "github.com/pion/webrtc/v3"
"go.uber.org/zap"
. "m7s.live/engine/v4"
"m7s.live/engine/v4/codec"
"m7s.live/engine/v4/track"
@@ -218,7 +219,7 @@ func (suber *WebRTCSubscriber) OnEvent(event any) {
}()
}
case PeerConnectionStateDisconnected, PeerConnectionStateFailed:
suber.Stop()
suber.Stop(zap.String("reason", pcs.String()))
}
})
default: