diff --git a/pkg/tester/source.go b/pkg/tester/source.go index 558b046..dc4e226 100644 --- a/pkg/tester/source.go +++ b/pkg/tester/source.go @@ -6,6 +6,7 @@ import ( "github.com/AlexxIT/go2rtc/pkg/bubble" "github.com/AlexxIT/go2rtc/pkg/core" + "github.com/AlexxIT/go2rtc/pkg/rtmp" "github.com/AlexxIT/go2rtc/pkg/rtsp" ) @@ -30,6 +31,9 @@ func init() { RegisterSource("rtsps", rtspHandler) RegisterSource("rtspx", rtspHandler) RegisterSource("bubble", bubbleHandler) + RegisterSource("rtmp", rtmpHandler) + RegisterSource("rtmps", rtmpHandler) + RegisterSource("rtmpx", rtmpHandler) } // bubbleHandler -- Dial handles TCP connect, HTTP handshake, XML parsing, and auth. @@ -38,6 +42,12 @@ func bubbleHandler(rawURL string) (core.Producer, error) { return bubble.Dial(rawURL) } +// rtmpHandler -- DialPlay handles TCP connect, RTMP handshake, and play command. +// ex. "rtmp://admin:pass@192.168.1.100:1935/bcs/channel0_main.bcs?channel=0&stream=0" +func rtmpHandler(rawURL string) (core.Producer, error) { + return rtmp.DialPlay(rawURL) +} + // rtspHandler -- Dial + Describe. Proves: port open, RTSP responds, auth OK, SDP received. func rtspHandler(rawURL string) (core.Producer, error) { rawURL, _, _ = strings.Cut(rawURL, "#")