git » sdk » commit 7edad4b

webrtc.org does not support mid longer than 16

author Stephen Paul Weber
2026-11-04 02:25:37 UTC
committer Stephen Paul Weber
2026-11-04 02:25:37 UTC
parent e4f71ab89ddc3d630e09c37cd65b72cf34b528dc

webrtc.org does not support mid longer than 16

borogove/ID.hx +8 -0
borogove/calls/PeerConnection.cpp.hx +1 -1

diff --git a/borogove/ID.hx b/borogove/ID.hx
index 3c80ee8..6e15a6a 100644
--- a/borogove/ID.hx
+++ b/borogove/ID.hx
@@ -1,9 +1,17 @@
 package borogove;
 
+import hx.strings.RandomStrings;
 import UUIDv7;
 
 class ID {
 	public static inline function unique():String {
 		return uuidv7();
 	}
+
+	/*
+		For when a uuid would be too big to fit
+	*/
+	public static function random(len: Int):String {
+		return RandomStrings.randomAsciiAlphaNumeric(len);
+	}
 }
diff --git a/borogove/calls/PeerConnection.cpp.hx b/borogove/calls/PeerConnection.cpp.hx
index 9ee06fa..0405af2 100644
--- a/borogove/calls/PeerConnection.cpp.hx
+++ b/borogove/calls/PeerConnection.cpp.hx
@@ -650,7 +650,7 @@ class MediaStream {
 		Create default bidirectional audio track
 	**/
 	public static function makeAudio(): MediaStream {
-		final audio = new DescriptionAudio(cpp.StdString.ofString(ID.unique()), SendRecv);
+		final audio = new DescriptionAudio(cpp.StdString.ofString(ID.random(16)), SendRecv);
 		audio.addOpusCodec(107); // May need to get from rtpmap?
 		audio.addPCMUCodec(0);
 		audio.addAudioCodec(101, cpp.StdString.ofString("telephone-event/8000")); // May need to get from rtpmap?