Committed by
GitHub
add data channel info to syncstate (#65)
* update protocol * add data channel info to syncstate
正在显示
2 个修改的文件
包含
12 行增加
和
1 行删除
| @@ -704,10 +704,21 @@ internal constructor( | @@ -704,10 +704,21 @@ internal constructor( | ||
| 704 | ) { | 704 | ) { |
| 705 | val answer = subscriber.peerConnection.localDescription.toProtoSessionDescription() | 705 | val answer = subscriber.peerConnection.localDescription.toProtoSessionDescription() |
| 706 | 706 | ||
| 707 | + val dataChannelInfos = LivekitModels.DataPacket.Kind.values() | ||
| 708 | + .toList() | ||
| 709 | + .mapNotNull { kind -> dataChannelForKind(kind) } | ||
| 710 | + .map { dataChannel -> | ||
| 711 | + LivekitRtc.DataChannelInfo.newBuilder() | ||
| 712 | + .setId(dataChannel.id()) | ||
| 713 | + .setLabel(dataChannel.label()) | ||
| 714 | + .build() | ||
| 715 | + } | ||
| 716 | + | ||
| 707 | val syncState = LivekitRtc.SyncState.newBuilder() | 717 | val syncState = LivekitRtc.SyncState.newBuilder() |
| 708 | .setAnswer(answer) | 718 | .setAnswer(answer) |
| 709 | .setSubscription(subscription) | 719 | .setSubscription(subscription) |
| 710 | .addAllPublishTracks(publishedTracks) | 720 | .addAllPublishTracks(publishedTracks) |
| 721 | + .addAllDataChannels(dataChannelInfos) | ||
| 711 | .build() | 722 | .build() |
| 712 | 723 | ||
| 713 | client.sendSyncState(syncState) | 724 | client.sendSyncState(syncState) |
-
请 注册 或 登录 后发表评论