mirror of
https://github.com/Monibuca/plugin-hdl.git
synced 2025-10-05 16:56:55 +08:00
适配引擎变更
This commit is contained in:
7
main.go
7
main.go
@@ -8,7 +8,6 @@ import (
|
|||||||
"strings"
|
"strings"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
. "github.com/logrusorgru/aurora"
|
|
||||||
amf "github.com/zhangpeihao/goamf"
|
amf "github.com/zhangpeihao/goamf"
|
||||||
"go.uber.org/zap"
|
"go.uber.org/zap"
|
||||||
. "m7s.live/engine/v4"
|
. "m7s.live/engine/v4"
|
||||||
@@ -27,12 +26,6 @@ type HDLConfig struct {
|
|||||||
func (c *HDLConfig) OnEvent(event any) {
|
func (c *HDLConfig) OnEvent(event any) {
|
||||||
switch v := event.(type) {
|
switch v := event.(type) {
|
||||||
case FirstConfig:
|
case FirstConfig:
|
||||||
if c.ListenAddr != "" || c.ListenAddrTLS != "" {
|
|
||||||
plugin.Info(Green("HDL Server Start").String(), zap.String("ListenAddr", c.ListenAddr), zap.String("ListenAddrTLS", c.ListenAddrTLS))
|
|
||||||
go c.Listen(plugin, c)
|
|
||||||
} else {
|
|
||||||
plugin.Info(Green("HDL start reuse engine port").String())
|
|
||||||
}
|
|
||||||
if c.PullOnStart {
|
if c.PullOnStart {
|
||||||
for streamPath, url := range c.PullList {
|
for streamPath, url := range c.PullList {
|
||||||
if err := plugin.Pull(streamPath, url, new(HDLPuller), false); err != nil {
|
if err := plugin.Pull(streamPath, url, new(HDLPuller), false); err != nil {
|
||||||
|
2
pull.go
2
pull.go
@@ -15,7 +15,7 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
func (puller *HDLPuller) Connect() (err error) {
|
func (puller *HDLPuller) Connect() (err error) {
|
||||||
puller.ReConnectCount++
|
|
||||||
log.Info("connect", zap.String("remoteURL", puller.RemoteURL))
|
log.Info("connect", zap.String("remoteURL", puller.RemoteURL))
|
||||||
if strings.HasPrefix(puller.RemoteURL, "http") {
|
if strings.HasPrefix(puller.RemoteURL, "http") {
|
||||||
var res *http.Response
|
var res *http.Response
|
||||||
|
Reference in New Issue
Block a user