mirror of
https://github.com/AlexxIT/go2rtc.git
synced 2025-09-27 04:36:12 +08:00
20 lines
360 B
Go
20 lines
360 B
Go
package rtmp
|
|
|
|
import (
|
|
"github.com/AlexxIT/go2rtc/cmd/streams"
|
|
"github.com/AlexxIT/go2rtc/pkg/rtmp"
|
|
"github.com/AlexxIT/go2rtc/pkg/streamer"
|
|
)
|
|
|
|
func Init() {
|
|
streams.HandleFunc("rtmp", handle)
|
|
}
|
|
|
|
func handle(url string) (streamer.Producer, error) {
|
|
conn := rtmp.NewClient(url)
|
|
if err := conn.Dial(); err != nil {
|
|
return nil, err
|
|
}
|
|
return conn, nil
|
|
}
|