Toggle navigation
Toggle navigation
此项目
正在载入...
Sign in
xuning
/
livekitAndroidXuningTest
转到一个项目
Toggle navigation
项目
群组
代码片段
帮助
Toggle navigation pinning
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Authored by
David Zhao
2021-06-12 20:46:32 -0700
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
5ae472546585f1d5cf481466b336c5e1e2a7a87b
5ae47254
1 parent
9c0452ca
Support for sending data packets to specific participants
显示空白字符变更
内嵌
并排对比
正在显示
1 个修改的文件
包含
8 行增加
和
5 行删除
livekit-android-sdk/src/main/java/io/livekit/android/room/participant/LocalParticipant.kt
livekit-android-sdk/src/main/java/io/livekit/android/room/participant/LocalParticipant.kt
查看文件 @
5ae4725
...
...
@@ -151,8 +151,9 @@ internal constructor(
*
* @param data payload to send
* @param reliability for delivery guarantee, use RELIABLE. for fastest delivery without guarantee, use LOSSY
* @param destination list of participant SIDs to deliver the payload, null to deliver to everyone
*/
fun publishData(data: ByteArray, reliability: DataPublishReliability) {
fun publishData(data: ByteArray, reliability: DataPublishReliability
, destination: List<String>?
) {
if (data.size > RTCEngine.MAX_DATA_PACKET_SIZE) {
throw IllegalArgumentException("cannot publish data larger than " + RTCEngine.MAX_DATA_PACKET_SIZE)
}
...
...
@@ -166,12 +167,14 @@ internal constructor(
DataPublishReliability.LOSSY -> engine.lossyDataChannel
} ?: throw TrackException.PublishException("data channel not established")
val
userPacket
= LivekitRtc.UserPacket.newBuilder().
val
packetBuilder
= LivekitRtc.UserPacket.newBuilder().
setPayload(ByteString.copyFrom(data)).
setParticipantSid(sid).
build()
setParticipantSid(sid)
if (destination != null) {
packetBuilder.addAllDestinationSids(destination)
}
val dataPacket = LivekitRtc.DataPacket.newBuilder().
setUser(
userPacket
).
setUser(
packetBuilder
).
setKind(kind).
build()
val buf = DataChannel.Buffer(
...
...
请
注册
或
登录
后发表评论