Skip to content

Commit

Permalink
add data channel info to syncstate (#65)
Browse files Browse the repository at this point in the history
* update protocol

* add data channel info to syncstate
  • Loading branch information
davidliu authored Mar 24, 2022
1 parent 830bcb4 commit 0ffff8b
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -704,10 +704,21 @@ internal constructor(
) {
val answer = subscriber.peerConnection.localDescription.toProtoSessionDescription()

val dataChannelInfos = LivekitModels.DataPacket.Kind.values()
.toList()
.mapNotNull { kind -> dataChannelForKind(kind) }
.map { dataChannel ->
LivekitRtc.DataChannelInfo.newBuilder()
.setId(dataChannel.id())
.setLabel(dataChannel.label())
.build()
}

val syncState = LivekitRtc.SyncState.newBuilder()
.setAnswer(answer)
.setSubscription(subscription)
.addAllPublishTracks(publishedTracks)
.addAllDataChannels(dataChannelInfos)
.build()

client.sendSyncState(syncState)
Expand Down

0 comments on commit 0ffff8b

Please sign in to comment.