mirror of
https://github.com/Monibuca/plugin-webrtc.git
synced 2025-10-04 22:42:44 +08:00
加入订阅测试页面
This commit is contained in:
9
main.go
9
main.go
@@ -47,7 +47,8 @@ import (
|
||||
|
||||
//go:embed publish.html
|
||||
var publishHTML []byte
|
||||
|
||||
//go:embed subscribe.html
|
||||
var subscribeHTML []byte
|
||||
var (
|
||||
reg_level = regexp.MustCompile("profile-level-id=(4.+f)")
|
||||
)
|
||||
@@ -144,7 +145,7 @@ func (conf *WebRTCConfig) Push_(w http.ResponseWriter, r *http.Request) {
|
||||
http.Error(w, err.Error(), http.StatusInternalServerError)
|
||||
return
|
||||
}
|
||||
// puber.SetIO(puber.PeerConnection)
|
||||
puber.SetIO(puber.PeerConnection) //TODO: 单PC需要注释掉
|
||||
puber.OnICECandidate(func(ice *ICECandidate) {
|
||||
if ice != nil {
|
||||
puber.Info(ice.ToJSON().Candidate)
|
||||
@@ -206,7 +207,9 @@ func (conf *WebRTCConfig) Push_(w http.ResponseWriter, r *http.Request) {
|
||||
func (conf *WebRTCConfig) Test_Publish(w http.ResponseWriter, r *http.Request) {
|
||||
w.Write(publishHTML)
|
||||
}
|
||||
|
||||
func (conf *WebRTCConfig) Test_Subscribe(w http.ResponseWriter, r *http.Request) {
|
||||
w.Write(subscribeHTML)
|
||||
}
|
||||
var webrtcConfig WebRTCConfig
|
||||
|
||||
var WebRTCPlugin = engine.InstallPlugin(&webrtcConfig)
|
||||
|
Reference in New Issue
Block a user