正在显示
2 个修改的文件
包含
10 行增加
和
0 行删除
| @@ -388,9 +388,14 @@ constructor( | @@ -388,9 +388,14 @@ constructor( | ||
| 388 | } | 388 | } |
| 389 | } | 389 | } |
| 390 | 390 | ||
| 391 | + // backwards compatibility for protocol version < 6 | ||
| 392 | + val trackSids = participantTracksList.map { it.trackSidsList } | ||
| 393 | + .flatten() | ||
| 394 | + | ||
| 391 | val subscription = LivekitRtc.UpdateSubscription.newBuilder() | 395 | val subscription = LivekitRtc.UpdateSubscription.newBuilder() |
| 392 | .setSubscribe(!sendUnsub) | 396 | .setSubscribe(!sendUnsub) |
| 393 | .addAllParticipantTracks(participantTracksList) | 397 | .addAllParticipantTracks(participantTracksList) |
| 398 | + .addAllTrackSids(trackSids) | ||
| 394 | .build() | 399 | .build() |
| 395 | val publishedTracks = localParticipant.publishTracksInfo() | 400 | val publishedTracks = localParticipant.publishTracksInfo() |
| 396 | engine.sendSyncState(subscription, publishedTracks) | 401 | engine.sendSyncState(subscription, publishedTracks) |
| @@ -347,8 +347,13 @@ constructor( | @@ -347,8 +347,13 @@ constructor( | ||
| 347 | } | 347 | } |
| 348 | 348 | ||
| 349 | fun sendUpdateSubscription(subscribe: Boolean, vararg participantTracks: LivekitModels.ParticipantTracks) { | 349 | fun sendUpdateSubscription(subscribe: Boolean, vararg participantTracks: LivekitModels.ParticipantTracks) { |
| 350 | + val participantTracksList = participantTracks.toList() | ||
| 351 | + | ||
| 352 | + // backwards compatibility for protocol version < 6 | ||
| 353 | + val trackSids = participantTracksList.map { it.trackSidsList }.flatten() | ||
| 350 | val subscription = LivekitRtc.UpdateSubscription.newBuilder() | 354 | val subscription = LivekitRtc.UpdateSubscription.newBuilder() |
| 351 | .addAllParticipantTracks(participantTracks.toList()) | 355 | .addAllParticipantTracks(participantTracks.toList()) |
| 356 | + .addAllTrackSids(trackSids) | ||
| 352 | .setSubscribe(subscribe) | 357 | .setSubscribe(subscribe) |
| 353 | 358 | ||
| 354 | val request = LivekitRtc.SignalRequest.newBuilder() | 359 | val request = LivekitRtc.SignalRequest.newBuilder() |
-
请 注册 或 登录 后发表评论