mirror of
https://github.com/Monibuca/plugin-webrtc.git
synced 2025-10-06 15:26:56 +08:00
修复一个变量引用错误
This commit is contained in:
5
main.go
5
main.go
@@ -42,7 +42,6 @@ import (
|
|||||||
// }
|
// }
|
||||||
var (
|
var (
|
||||||
reg_level = regexp.MustCompile("profile-level-id=(4.+f)")
|
reg_level = regexp.MustCompile("profile-level-id=(4.+f)")
|
||||||
api *API
|
|
||||||
)
|
)
|
||||||
|
|
||||||
type WebRTCConfig struct {
|
type WebRTCConfig struct {
|
||||||
@@ -87,7 +86,7 @@ func (conf *WebRTCConfig) Play_(w http.ResponseWriter, r *http.Request) {
|
|||||||
bytes, err := ioutil.ReadAll(r.Body)
|
bytes, err := ioutil.ReadAll(r.Body)
|
||||||
var suber WebRTCSubscriber
|
var suber WebRTCSubscriber
|
||||||
suber.SDP = string(bytes)
|
suber.SDP = string(bytes)
|
||||||
if suber.PeerConnection, err = api.NewPeerConnection(Configuration{}); err != nil {
|
if suber.PeerConnection, err = conf.api.NewPeerConnection(Configuration{}); err != nil {
|
||||||
http.Error(w, err.Error(), http.StatusInternalServerError)
|
http.Error(w, err.Error(), http.StatusInternalServerError)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
@@ -117,7 +116,7 @@ func (conf *WebRTCConfig) Push_(w http.ResponseWriter, r *http.Request) {
|
|||||||
bytes, err := ioutil.ReadAll(r.Body)
|
bytes, err := ioutil.ReadAll(r.Body)
|
||||||
var puber WebRTCPublisher
|
var puber WebRTCPublisher
|
||||||
puber.SDP = string(bytes)
|
puber.SDP = string(bytes)
|
||||||
if puber.PeerConnection, err = api.NewPeerConnection(Configuration{}); err != nil {
|
if puber.PeerConnection, err = conf.api.NewPeerConnection(Configuration{}); err != nil {
|
||||||
http.Error(w, err.Error(), http.StatusInternalServerError)
|
http.Error(w, err.Error(), http.StatusInternalServerError)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user