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
davidliu
2022-06-07 19:47:57 +0900
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Committed by
GitHub
2022-06-07 19:47:57 +0900
Commit
9f5eda2878868afb565363b9aece613127841392
9f5eda28
1 parent
de6354ea
set permission by identity (#91)
* update protocol repo * Permission by identity
隐藏空白字符变更
内嵌
并排对比
正在显示
3 个修改的文件
包含
42 行增加
和
3 行删除
livekit-android-sdk/src/main/java/io/livekit/android/room/participant/LocalParticipant.kt
livekit-android-sdk/src/test/java/io/livekit/android/room/participant/ParticipantTrackPermissionTest.kt
protocol
livekit-android-sdk/src/main/java/io/livekit/android/room/participant/LocalParticipant.kt
查看文件 @
9f5eda2
...
...
@@ -650,22 +650,34 @@ data class AudioTrackPublishOptions(
data class ParticipantTrackPermission(
/**
* The participant identity this permission applies to.
* You can either provide this or `participantSid`
*/
val participantIdentity: String? = null,
/**
* The participant id this permission applies to.
*/
val participantSid: String,
val participantSid: String
? = null
,
/**
* If set to true, the target participant can subscribe to all tracks from the local participant.
*
* Takes precedence over [allowedTrackSids].
*/
val allTracksAllowed: Boolean,
val allTracksAllowed: Boolean
= false
,
/**
* The list of track ids that the target participant can subscribe to.
*/
val allowedTrackSids: List<String> = emptyList()
) {
init {
if (participantIdentity == null && participantSid == null) {
throw IllegalArgumentException("Either identity or sid must be provided.")
}
}
fun toProto(): LivekitRtc.TrackPermission {
return LivekitRtc.TrackPermission.newBuilder()
.setParticipantIdentity(participantIdentity)
.setParticipantSid(participantSid)
.setAllTracks(allTracksAllowed)
.addAllTrackSids(allowedTrackSids)
...
...
livekit-android-sdk/src/test/java/io/livekit/android/room/participant/ParticipantTrackPermissionTest.kt
0 → 100644
查看文件 @
9f5eda2
package io.livekit.android.room.participant
import org.junit.Test
class ParticipantTrackPermissionTest {
@Test(expected = IllegalArgumentException::class)
fun requireSidOrIdentity() {
ParticipantTrackPermission(
participantIdentity = null,
participantSid = null
)
}
@Test
fun sidConstructionDoesntThrow() {
ParticipantTrackPermission(
participantSid = "sid"
)
}
@Test
fun identyConstructionDoesntThrow() {
ParticipantTrackPermission(
participantIdentity = "identity"
)
}
}
\ No newline at end of file
...
...
protocol
@
51a8116f
Subproject commit
e3f22408016f5ef825b6a03e4d36a5f977a05745
Subproject commit
51a8116f88b2c88ee1492c6a4d512b4611400918
...
...
请
注册
或
登录
后发表评论