mirror of
https://github.com/Monibuca/plugin-rtmp.git
synced 2025-10-04 07:06:45 +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 {
|
type RTMPPusher struct {
|
||||||
RTMPSender
|
RTMPSender
|
||||||
engine.Pusher
|
engine.Pusher
|
||||||
|
isClientStop bool
|
||||||
}
|
}
|
||||||
|
|
||||||
func (pusher *RTMPPusher) Connect() (err error) {
|
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 {
|
type RTMPPuller struct {
|
||||||
RTMPReceiver
|
RTMPReceiver
|
||||||
engine.Puller
|
engine.Puller
|
||||||
|
Reference in New Issue
Block a user