Merge pull request #8 from dwdcth/patch-1

embed
This commit is contained in:
dexter
2021-03-20 12:53:07 +08:00
committed by GitHub
2 changed files with 7 additions and 1 deletions

2
go.mod
View File

@@ -1,6 +1,6 @@
module github.com/Monibuca/plugin-rtsp/v3
go 1.13
go 1.16
require (
github.com/Monibuca/engine/v3 v3.0.0-alpha6

View File

@@ -2,6 +2,7 @@ package rtsp
import (
"bufio"
"embed"
"fmt"
"log"
"net"
@@ -28,11 +29,16 @@ var config = struct {
}
}{":554", false, "rtsp://localhost/${streamPath}", 0, false, nil}
//go:embed ui/*
//go:embed README.md
var ui embed.FS
func init() {
InstallPlugin(&PluginConfig{
Name: "RTSP",
Config: &config,
Run: runPlugin,
UIFile: &ui,
HotConfig: map[string]func(interface{}){
"AutoPull": func(value interface{}) {
config.AutoPull = value.(bool)