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:
parent
b42bf496c7
commit
bfeca8e068
5 changed files with 257 additions and 16 deletions
12
trunk/3rdparty/signaling/main.go
vendored
12
trunk/3rdparty/signaling/main.go
vendored
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue