mirror of
https://github.com/Monibuca/plugin-webrtc.git
synced 2025-10-04 22:42:44 +08:00
加入测试页面
This commit is contained in:
11
main.go
11
main.go
@@ -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)
|
||||
|
Reference in New Issue
Block a user