From 33d44b906dc43964cc5cb8b45d37f76471ce6e30 Mon Sep 17 00:00:00 2001 From: banshan Date: Sun, 26 Feb 2023 10:36:46 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A7=A3=E5=86=B3repush=3D-1=E6=97=B6=E5=AE=A2?= =?UTF-8?q?=E6=88=B7=E7=AB=AF=E5=81=9C=E6=AD=A2=E6=8E=A8=E6=B5=81=E5=90=8E?= =?UTF-8?q?=E4=B8=80=E7=9B=B4=E6=8E=A8=E6=B5=81=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- client.go | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/client.go b/client.go index 0983efa..0568419 100644 --- a/client.go +++ b/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