mirror of
https://github.com/Monibuca/plugin-rtmp.git
synced 2025-09-26 19:51:38 +08:00
解决repush=-1时客户端停止推流后一直推流的问题
This commit is contained in:
12
client.go
12
client.go
@@ -100,6 +100,7 @@ func NewRTMPClient(addr string) (client *NetConnection, err error) {
|
||||
type RTMPPusher struct {
|
||||
RTMPSender
|
||||
engine.Pusher
|
||||
isClientStop bool
|
||||
}
|
||||
|
||||
func (pusher *RTMPPusher) Connect() (err error) {
|
||||
@@ -157,6 +158,17 @@ func (pusher *RTMPPusher) Push() error {
|
||||
}
|
||||
}
|
||||
|
||||
func (pusher *RTMPPusher) OnEvent(event any) {
|
||||
switch event.(type) {
|
||||
case engine.SEclose:
|
||||
pusher.isClientStop = true
|
||||
}
|
||||
}
|
||||
|
||||
func (pusher *RTMPPusher) IsShutdown() bool {
|
||||
return pusher.isClientStop
|
||||
}
|
||||
|
||||
type RTMPPuller struct {
|
||||
RTMPReceiver
|
||||
engine.Puller
|
||||
|
Reference in New Issue
Block a user