mirror of
https://github.com/Monibuca/plugin-rtmp.git
synced 2025-09-27 12:02:50 +08:00
27 lines
454 B
Go
27 lines
454 B
Go
package rtmp
|
|
|
|
import (
|
|
"log"
|
|
|
|
. "github.com/Monibuca/engine/v2"
|
|
. "github.com/logrusorgru/aurora"
|
|
)
|
|
|
|
var config = struct {
|
|
ListenAddr string
|
|
ChunkSize int
|
|
}{":1935", 512}
|
|
|
|
func init() {
|
|
InstallPlugin(&PluginConfig{
|
|
Name: "RTMP",
|
|
Type: PLUGIN_SUBSCRIBER | PLUGIN_PUBLISHER,
|
|
Config: &config,
|
|
Run: run,
|
|
})
|
|
}
|
|
func run() {
|
|
Print(Green("server rtmp start at"), BrightBlue(config.ListenAddr))
|
|
log.Fatal(ListenRtmp(config.ListenAddr))
|
|
}
|