mirror of
https://github.com/Monibuca/plugin-rtmp.git
synced 2025-10-05 15:37:11 +08:00
26 lines
439 B
Go
26 lines
439 B
Go
package rtmp
|
|
|
|
import (
|
|
. "github.com/Monibuca/engine/v3"
|
|
. "github.com/Monibuca/utils/v3"
|
|
. "github.com/logrusorgru/aurora"
|
|
"log"
|
|
)
|
|
|
|
var config = struct {
|
|
ListenAddr string
|
|
ChunkSize int
|
|
}{":1935", 512}
|
|
|
|
func init() {
|
|
InstallPlugin(&PluginConfig{
|
|
Name: "RTMP",
|
|
Config: &config,
|
|
Run: run,
|
|
})
|
|
}
|
|
func run() {
|
|
Print(Green("server rtmp start at"), BrightBlue(config.ListenAddr))
|
|
log.Fatal(ListenRtmp(config.ListenAddr))
|
|
}
|