1
0
mirror of https://gitlab.crans.org/nounous/ghostream.git synced 2025-06-27 19:12:07 +02:00

Try to add a quality selector (WIP), see #4

This commit is contained in:
Yohann D'ANELLO
2020-10-06 00:06:52 +02:00
parent 192c86f140
commit 07983a1c71
5 changed files with 33 additions and 2 deletions

View File

@ -4,6 +4,7 @@ import (
"fmt"
"log"
"math/rand"
"strings"
"github.com/pion/webrtc/v3"
"gitlab.crans.org/nounous/ghostream/internal/monitoring"
@ -120,6 +121,14 @@ func newPeerHandler(remoteSdp struct {
}
streamID := remoteSdp.StreamID
split := strings.SplitN(streamID, "@", 2)
streamID = split[0]
quality := "source"
if len(split) == 2 {
quality = split[1]
}
log.Printf("New WebRTC session for stream %s, quality %s", streamID, quality)
// TODO Consider the quality
// Set the handler for ICE connection state
// This will notify you when the peer has connected/disconnected