Change url param to src in Web API
This commit is contained in:
+2
-2
@@ -8,8 +8,8 @@ import (
|
||||
)
|
||||
|
||||
func frameHandler(w http.ResponseWriter, r *http.Request) {
|
||||
url := r.URL.Query().Get("url")
|
||||
stream := streams.Get(url)
|
||||
src := r.URL.Query().Get("src")
|
||||
stream := streams.Get(src)
|
||||
if stream == nil {
|
||||
return
|
||||
}
|
||||
|
||||
+2
-2
@@ -13,8 +13,8 @@ func Init() {
|
||||
}
|
||||
|
||||
func handler(ctx *api.Context, msg *streamer.Message) {
|
||||
url := ctx.Request.URL.Query().Get("url")
|
||||
stream := streams.Get(url)
|
||||
src := ctx.Request.URL.Query().Get("src")
|
||||
stream := streams.Get(src)
|
||||
if stream == nil {
|
||||
return
|
||||
}
|
||||
|
||||
@@ -63,13 +63,13 @@ var log zerolog.Logger
|
||||
var NewPConn func() (*pion.PeerConnection, error)
|
||||
|
||||
func offerHandler(ctx *api.Context, msg *streamer.Message) {
|
||||
name := ctx.Request.URL.Query().Get("url")
|
||||
stream := streams.Get(name)
|
||||
src := ctx.Request.URL.Query().Get("src")
|
||||
stream := streams.Get(src)
|
||||
if stream == nil {
|
||||
return
|
||||
}
|
||||
|
||||
log.Debug().Str("stream", name).Msg("[webrtc] new consumer")
|
||||
log.Debug().Str("src", src).Msg("[webrtc] new consumer")
|
||||
|
||||
var err error
|
||||
|
||||
|
||||
+3
-3
@@ -63,9 +63,9 @@
|
||||
);
|
||||
|
||||
const links = [
|
||||
'<a href="webrtc.html?url={name}">webrtc</a>',
|
||||
'<a href="mse.html?url={name}">mse</a>',
|
||||
'<a href="api/frame.mp4?url={name}">frame.mp4</a>',
|
||||
'<a href="webrtc.html?src={name}">webrtc</a>',
|
||||
'<a href="mse.html?src={name}">mse</a>',
|
||||
'<a href="api/frame.mp4?src={name}">frame.mp4</a>',
|
||||
'<a href="api/streams?src={name}">info</a>',
|
||||
];
|
||||
|
||||
|
||||
Reference in New Issue
Block a user