mirror of
https://github.com/livekit/livekit.git
synced 2026-05-22 21:25:45 +00:00
22 lines
377 B
Go
22 lines
377 B
Go
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
|
|
}
|