1
0
Fork 0
mirror of https://github.com/ossrs/srs.git synced 2025-03-09 15:49:59 +00:00

Tools: Add video room demo

This commit is contained in:
winlin 2021-05-04 10:46:56 +08:00
parent b42bf496c7
commit bfeca8e068
5 changed files with 257 additions and 16 deletions

View file

@ -190,10 +190,16 @@ func main() {
var self *Participant
go func() {
<-ctx.Done()
if self != nil {
self.Room.Remove(self)
logger.Tf(ctx, "Remove client %v", self)
if self == nil {
return
}
// Notify other peers that we're quiting.
// @remark The ctx(of self) is done, so we must use a new context.
go self.Room.Notify(context.Background(), self, "leave", "", "")
self.Room.Remove(self)
logger.Tf(ctx, "Remove client %v", self)
}()
inMessages := make(chan []byte, 0)