refactor: move media channel handling to common/ and setup duplex channel

a duplex media channel should be more realistic, you generally both send and receive media when doing video call and
stuff
This commit is contained in:
KokaKiwi 2025-08-16 18:48:43 +02:00
parent ff738ff045
commit 01bde142d4
No known key found for this signature in database
GPG key ID: FD333F84686EFE78
5 changed files with 187 additions and 102 deletions

View file

@ -0,0 +1,20 @@
package media
import (
"testing"
)
func TestMediaChannelStop(t *testing.T) {
mc := NewMediaChannel()
// This should not panic
mc.Stop()
// Verify that the stop channel is closed
select {
case <-mc.stopCh:
// Channel is closed, which is expected
default:
t.Fatal("MediaChannel stopCh should be closed after Stop()")
}
}