加入测试页面

This commit is contained in:
dexter
2023-02-21 21:29:53 +08:00
parent 5526f1e44c
commit 89ebf28810
3 changed files with 70 additions and 1 deletions

11
main.go
View File

@@ -10,8 +10,9 @@ import (
"go.uber.org/zap"
"m7s.live/engine/v4"
"github.com/pion/interceptor"
_ "embed"
"github.com/pion/interceptor"
. "github.com/pion/webrtc/v3"
"m7s.live/engine/v4/config"
"m7s.live/plugin/webrtc/v4/webrtc"
@@ -43,6 +44,10 @@ import (
// conn *net.UDPConn
// port int
// }
//go:embed publish.html
var publishHTML []byte
var (
reg_level = regexp.MustCompile("profile-level-id=(4.+f)")
)
@@ -168,6 +173,10 @@ func (conf *WebRTCConfig) Push_(w http.ResponseWriter, r *http.Request) {
}
}
func (conf *WebRTCConfig) Test_Publish(w http.ResponseWriter, r *http.Request) {
w.Write(publishHTML)
}
var webrtcConfig WebRTCConfig
var WebRTCPlugin = engine.InstallPlugin(&webrtcConfig)