client consumes provided track

This commit is contained in:
David Zhao
2020-11-13 12:31:01 -08:00
parent 256328c4ff
commit c618f8c42f
13 changed files with 388 additions and 211 deletions
+21
View File
@@ -0,0 +1,21 @@
package rtc
import (
"strings"
)
const (
trackIdSeparator = "|"
)
func UnpackPeerTrack(packed string) (peerId string, trackId string) {
parts := strings.Split(packed, trackIdSeparator)
if len(parts) > 1 {
return parts[0], packed[len(parts[0]):]
}
return "", packed
}
func PackPeerTrack(peerId, trackId string) string {
return peerId + trackIdSeparator + trackId
}