暂停,需要解决一些问题

This commit is contained in:
Sense T
2022-09-30 05:46:58 +00:00
parent dc9b5ce0b1
commit c22c399f40
4 changed files with 10 additions and 2 deletions

View File

@@ -61,7 +61,7 @@ func New(o *Options) (*Connection, error) {
}
func (c *Connection) Regist(offer *webrtc.SessionDescription) (*webrtc.SessionDescription, error) {
logrus.Debug("received offer ", offer)
logrus.Debug("received offer ")
rtc, err := c.api.NewPeerConnection(webrtc.Configuration{
ICEServers: []webrtc.ICEServer{
@@ -78,6 +78,10 @@ func (c *Connection) Regist(offer *webrtc.SessionDescription) (*webrtc.SessionDe
logrus.Debug("connection state has changed: ", connectionState.String())
})
rtc.OnICECandidate(func(i *webrtc.ICECandidate) {
logrus.Debug("cadidate: ", i)
})
for _, track := range c.stream.GetTracks() {
track.OnEnded(func(err error) {
logrus.Errorf("Track (ID: %s, kind: %s) ended with error: %v", track.ID(), track.Kind().String(), err)