mirror of
https://github.com/AlexxIT/go2rtc.git
synced 2025-10-06 16:57:29 +08:00
Fix webrtc close when it starts from ws
This commit is contained in:
@@ -84,8 +84,8 @@ func offerHandler(ctx *api.Context, msg *streamer.Message) {
|
|||||||
conn.UserAgent = ctx.Request.UserAgent()
|
conn.UserAgent = ctx.Request.UserAgent()
|
||||||
conn.Listen(func(msg interface{}) {
|
conn.Listen(func(msg interface{}) {
|
||||||
switch msg := msg.(type) {
|
switch msg := msg.(type) {
|
||||||
case streamer.EventType:
|
case pion.PeerConnectionState:
|
||||||
if msg == streamer.StateNull {
|
if msg == pion.PeerConnectionStateClosed {
|
||||||
stream.RemoveConsumer(conn)
|
stream.RemoveConsumer(conn)
|
||||||
}
|
}
|
||||||
case *streamer.Message:
|
case *streamer.Message:
|
||||||
@@ -152,7 +152,7 @@ func ExchangeSDP(
|
|||||||
conn.Listen(func(msg interface{}) {
|
conn.Listen(func(msg interface{}) {
|
||||||
switch msg := msg.(type) {
|
switch msg := msg.(type) {
|
||||||
case pion.PeerConnectionState:
|
case pion.PeerConnectionState:
|
||||||
if msg == pion.PeerConnectionStateClosed{
|
if msg == pion.PeerConnectionStateClosed {
|
||||||
stream.RemoveConsumer(conn)
|
stream.RemoveConsumer(conn)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user