Add WebRTC sources for Amazon Kinesis and Wyze

This commit is contained in:
Alexey Khit
2023-07-19 23:19:05 +03:00
parent 7928f54a95
commit 3343c78699
6 changed files with 334 additions and 46 deletions
+9 -1
View File
@@ -1,11 +1,12 @@
package webrtc
import (
"testing"
"github.com/AlexxIT/go2rtc/pkg/core"
"github.com/pion/webrtc/v3"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"testing"
)
func TestClient(t *testing.T) {
@@ -100,3 +101,10 @@ a=recvonly
err = sender.ReplaceTrack(track)
require.Nil(t, err)
}
func TestUnmarshalICEServers(t *testing.T) {
s := `[{"credential":"xxx","urls":"xxx","username":"xxx"},{"credential":null,"urls":"xxx","username":null}]`
servers, err := UnmarshalICEServers([]byte(s))
require.Nil(t, err)
require.Len(t, servers, 2)
}