From ba8bf426e076d44052433b21cb1342db8a7de802 Mon Sep 17 00:00:00 2001 From: Alexandre Iooss Date: Thu, 22 Oct 2020 08:19:01 +0200 Subject: [PATCH] Fix JSON decoding --- web/websocket_handler.go | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/web/websocket_handler.go b/web/websocket_handler.go index e4bdd30..e774135 100644 --- a/web/websocket_handler.go +++ b/web/websocket_handler.go @@ -16,9 +16,9 @@ var upgrader = websocket.Upgrader{ // clientDescription is sent by new client type clientDescription struct { - webRtcSdp webrtc.SessionDescription - stream string - quality string + WebRtcSdp webrtc.SessionDescription + Stream string + Quality string } // websocketHandler exchanges WebRTC SDP and viewer count @@ -40,22 +40,22 @@ func websocketHandler(w http.ResponseWriter, r *http.Request) { } // Get requested stream - stream, err := streams.Get(c.stream) + stream, err := streams.Get(c.Stream) if err != nil { - log.Printf("Stream not found: %s", c.stream) + log.Printf("Stream not found: %s", c.Stream) return } // Get requested quality - q, err := stream.GetQuality(c.quality) + q, err := stream.GetQuality(c.Quality) if err != nil { - log.Printf("Quality not found: %s", c.quality) + log.Printf("Quality not found: %s", c.Quality) return } // Exchange session descriptions with WebRTC stream server // FIXME: Add trickle ICE support - q.WebRtcRemoteSdp <- c.webRtcSdp + q.WebRtcRemoteSdp <- c.WebRtcSdp localDescription := <-q.WebRtcLocalSdp // Send new local description