mirror of
https://github.com/m1k1o/neko.git
synced 2025-05-18 03:27:03 +02:00
audio start / stop in WebRTC.
This commit is contained in:
parent
cd18a22655
commit
2ac3f9876f
2 changed files with 51 additions and 31 deletions
|
@ -29,13 +29,6 @@ func (h *MessageHandlerCtx) SessionDeleted(session types.Session) error {
|
|||
}
|
||||
|
||||
func (h *MessageHandlerCtx) SessionConnected(session types.Session) error {
|
||||
// start audio, when first member connects
|
||||
if !h.capture.Audio().Started() {
|
||||
if err := h.capture.Audio().Start(); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
if err := h.systemInit(session); err != nil {
|
||||
return err
|
||||
}
|
||||
|
@ -50,11 +43,6 @@ func (h *MessageHandlerCtx) SessionConnected(session types.Session) error {
|
|||
}
|
||||
|
||||
func (h *MessageHandlerCtx) SessionDisconnected(session types.Session) error {
|
||||
// stop audio, if last member disonnects
|
||||
if h.capture.Audio().Started() && !h.sessions.HasConnectedMembers() {
|
||||
h.capture.Audio().Stop()
|
||||
}
|
||||
|
||||
// clear host if exists
|
||||
if session.IsHost() {
|
||||
h.desktop.ResetKeys()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue