修改URL地址形式

This commit is contained in:
dexter
2022-05-07 16:22:06 +08:00
parent 52b0c1b3a0
commit 4213e3a685
4 changed files with 46 additions and 16 deletions

View File

@@ -81,9 +81,9 @@ func (conf *WebRTCConfig) OnEvent(event any) {
}
}
func (conf *WebRTCConfig) API_play(w http.ResponseWriter, r *http.Request) {
func (conf *WebRTCConfig) Play_(w http.ResponseWriter, r *http.Request) {
w.Header().Set("Content-Type", "application/sdp")
streamPath := r.URL.Query().Get("streamPath")
streamPath := r.URL.Path[12:]
bytes, err := ioutil.ReadAll(r.Body)
var suber WebRTCSubscriber
suber.SDP = string(bytes)
@@ -111,9 +111,9 @@ func (conf *WebRTCConfig) API_play(w http.ResponseWriter, r *http.Request) {
}
}
func (conf *WebRTCConfig) API_publish(w http.ResponseWriter, r *http.Request) {
func (conf *WebRTCConfig) Push_(w http.ResponseWriter, r *http.Request) {
streamPath := r.URL.Path[12:]
w.Header().Set("Content-Type", "application/sdp")
streamPath := r.URL.Query().Get("streamPath")
bytes, err := ioutil.ReadAll(r.Body)
var puber WebRTCPublisher
puber.SDP = string(bytes)