Exemplo n.º 1
0
func watch(session *janus.Session, handle *janus.Handle, stop chan struct{}) {
	for {
		msg := <-handle.Events
		switch msg := msg.(type) {
		case *janus.MediaMsg:
			if msg.Receiving == "false" {
				handle.Detach()
				session.Destroy()
				close(stop)
				return
			}
		}
	}
}