Change url param to src in Web API

This commit is contained in:
Alexey Khit
2022-08-24 09:55:16 +03:00
parent 8f01b08d42
commit 8377cf2655
4 changed files with 10 additions and 10 deletions
+2 -2
View File
@@ -8,8 +8,8 @@ import (
) )
func frameHandler(w http.ResponseWriter, r *http.Request) { func frameHandler(w http.ResponseWriter, r *http.Request) {
url := r.URL.Query().Get("url") src := r.URL.Query().Get("src")
stream := streams.Get(url) stream := streams.Get(src)
if stream == nil { if stream == nil {
return return
} }
+2 -2
View File
@@ -13,8 +13,8 @@ func Init() {
} }
func handler(ctx *api.Context, msg *streamer.Message) { func handler(ctx *api.Context, msg *streamer.Message) {
url := ctx.Request.URL.Query().Get("url") src := ctx.Request.URL.Query().Get("src")
stream := streams.Get(url) stream := streams.Get(src)
if stream == nil { if stream == nil {
return return
} }
+3 -3
View File
@@ -63,13 +63,13 @@ var log zerolog.Logger
var NewPConn func() (*pion.PeerConnection, error) var NewPConn func() (*pion.PeerConnection, error)
func offerHandler(ctx *api.Context, msg *streamer.Message) { func offerHandler(ctx *api.Context, msg *streamer.Message) {
name := ctx.Request.URL.Query().Get("url") src := ctx.Request.URL.Query().Get("src")
stream := streams.Get(name) stream := streams.Get(src)
if stream == nil { if stream == nil {
return return
} }
log.Debug().Str("stream", name).Msg("[webrtc] new consumer") log.Debug().Str("src", src).Msg("[webrtc] new consumer")
var err error var err error
+3 -3
View File
@@ -63,9 +63,9 @@
); );
const links = [ const links = [
'<a href="webrtc.html?url={name}">webrtc</a>', '<a href="webrtc.html?src={name}">webrtc</a>',
'<a href="mse.html?url={name}">mse</a>', '<a href="mse.html?src={name}">mse</a>',
'<a href="api/frame.mp4?url={name}">frame.mp4</a>', '<a href="api/frame.mp4?src={name}">frame.mp4</a>',
'<a href="api/streams?src={name}">info</a>', '<a href="api/streams?src={name}">info</a>',
]; ];