mirror of
https://gitlab.crans.org/nounous/ghostream.git
synced 2024-12-23 14:22:20 +00:00
Fix JSON decoding
This commit is contained in:
parent
90d7bd4760
commit
ba8bf426e0
@ -16,9 +16,9 @@ var upgrader = websocket.Upgrader{
|
|||||||
|
|
||||||
// clientDescription is sent by new client
|
// clientDescription is sent by new client
|
||||||
type clientDescription struct {
|
type clientDescription struct {
|
||||||
webRtcSdp webrtc.SessionDescription
|
WebRtcSdp webrtc.SessionDescription
|
||||||
stream string
|
Stream string
|
||||||
quality string
|
Quality string
|
||||||
}
|
}
|
||||||
|
|
||||||
// websocketHandler exchanges WebRTC SDP and viewer count
|
// websocketHandler exchanges WebRTC SDP and viewer count
|
||||||
@ -40,22 +40,22 @@ func websocketHandler(w http.ResponseWriter, r *http.Request) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Get requested stream
|
// Get requested stream
|
||||||
stream, err := streams.Get(c.stream)
|
stream, err := streams.Get(c.Stream)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Printf("Stream not found: %s", c.stream)
|
log.Printf("Stream not found: %s", c.Stream)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
// Get requested quality
|
// Get requested quality
|
||||||
q, err := stream.GetQuality(c.quality)
|
q, err := stream.GetQuality(c.Quality)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Printf("Quality not found: %s", c.quality)
|
log.Printf("Quality not found: %s", c.Quality)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
// Exchange session descriptions with WebRTC stream server
|
// Exchange session descriptions with WebRTC stream server
|
||||||
// FIXME: Add trickle ICE support
|
// FIXME: Add trickle ICE support
|
||||||
q.WebRtcRemoteSdp <- c.webRtcSdp
|
q.WebRtcRemoteSdp <- c.WebRtcSdp
|
||||||
localDescription := <-q.WebRtcLocalSdp
|
localDescription := <-q.WebRtcLocalSdp
|
||||||
|
|
||||||
// Send new local description
|
// Send new local description
|
||||||
|
Loading…
Reference in New Issue
Block a user