Skip to content

Commit

Permalink
allow arbitrary q level
Browse files Browse the repository at this point in the history
  • Loading branch information
MutsiMutsi committed May 1, 2024
1 parent 5ffbbe2 commit 2021429
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -174,14 +174,10 @@ func receiveMessages() {
go replyText(strconv.Itoa(len(viewerAddresses)), msg)
} else if len(msg.Data) == 10 && string(msg.Data[:]) == "donationid" {
go replyText(generateDonationEntry(), msg)
} else if len(msg.Data) == 8 && string(msg.Data[:]) == "quality0" {
viewers.viewerQuality[msg.Src] = 0
go replyText(strconv.Itoa(segmentId), msg)
} else if len(msg.Data) == 8 && string(msg.Data[:]) == "quality1" {
viewers.viewerQuality[msg.Src] = 1
go replyText(strconv.Itoa(segmentId), msg)
} else if len(msg.Data) == 8 && string(msg.Data[:]) == "quality2" {
viewers.viewerQuality[msg.Src] = 2
} else if len(msg.Data) == 8 && strings.Contains(string(msg.Data[:]), "quality") {
qLevelStr, _ := strings.CutPrefix(string(msg.Data[:]), "quality")
qLevel, _ := strconv.Atoi(qLevelStr)
viewers.viewerQuality[msg.Src] = qLevel
go replyText(strconv.Itoa(segmentId), msg)
} else {
DecodeMessage(msg)
Expand Down

0 comments on commit 2021429

Please sign in to comment.