mirror of
https://github.com/kingecg/mpegts.git
synced 2025-09-27 04:15:55 +08:00
28 lines
506 B
Go
28 lines
506 B
Go
package mpegts
|
|
|
|
import (
|
|
. "m7s.live/engine/v4"
|
|
"m7s.live/engine/v4/config"
|
|
)
|
|
|
|
type MpegtsConfig struct {
|
|
// 定义插件的配置
|
|
config.Subscribe
|
|
Tinterval int
|
|
}
|
|
|
|
func (p *MpegtsConfig) OnEvent(event any) {
|
|
switch v := event.(type) {
|
|
case FirstConfig: //插件初始化逻辑
|
|
if p.Tinterval == 0 {
|
|
p.Tinterval = 1
|
|
}
|
|
plugin.Info("Started")
|
|
// case Config://插件热更新逻辑
|
|
case Stream: //按需拉流逻辑
|
|
plugin.Info(v.Path)
|
|
}
|
|
}
|
|
|
|
var plugin = InstallPlugin(new(MpegtsConfig))
|