Skip to content

Commit bee0a1e

Browse files
authored
Documentation updates for LocalParticipant methods (#510)
1 parent 41e5aa6 commit bee0a1e

File tree

2 files changed

+39
-0
lines changed

2 files changed

+39
-0
lines changed

.changeset/brave-buckets-fetch.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"client-sdk-android": patch
3+
---
4+
5+
Documentation updates for LocalParticipant methods

livekit-android-sdk/src/main/java/io/livekit/android/room/participant/LocalParticipant.kt

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ import io.livekit.android.events.ParticipantEvent
3030
import io.livekit.android.room.ConnectionState
3131
import io.livekit.android.room.DefaultsManager
3232
import io.livekit.android.room.RTCEngine
33+
import io.livekit.android.room.Room
3334
import io.livekit.android.room.TrackBitrateInfo
3435
import io.livekit.android.room.isSVCCodec
3536
import io.livekit.android.room.track.DataPublishReliability
@@ -110,6 +111,8 @@ internal constructor(
110111
/**
111112
* Creates an audio track, recording audio through the microphone with the given [options].
112113
*
114+
* @param name The name of the track.
115+
* @param options The capture options to use for this track, or [Room.audioTrackCaptureDefaults] if none is passed.
113116
* @exception SecurityException will be thrown if [Manifest.permission.RECORD_AUDIO] permission is missing.
114117
*/
115118
fun createAudioTrack(
@@ -124,6 +127,11 @@ internal constructor(
124127
*
125128
* This method will call [VideoCapturer.initialize] and handle the lifecycle of
126129
* [SurfaceTextureHelper].
130+
*
131+
* @param name The name of the track.
132+
* @param capturer The capturer to use for this track.
133+
* @param options The capture options to use for this track, or [Room.videoTrackCaptureDefaults] if none is passed.
134+
* @param videoProcessor A video processor to attach to this track that can modify the frames before publishing.
127135
*/
128136
fun createVideoTrack(
129137
name: String = "",
@@ -146,6 +154,9 @@ internal constructor(
146154
/**
147155
* Creates a video track, recording video through the camera with the given [options].
148156
*
157+
* @param name The name of the track
158+
* @param options The capture options to use for this track, or [Room.videoTrackCaptureDefaults] if none is passed.
159+
* @param videoProcessor A video processor to attach to this track that can modify the frames before publishing.
149160
* @exception SecurityException will be thrown if [Manifest.permission.CAMERA] permission is missing.
150161
*/
151162
fun createVideoTrack(
@@ -167,8 +178,11 @@ internal constructor(
167178
/**
168179
* Creates a screencast video track.
169180
*
181+
* @param name The name of the track.
170182
* @param mediaProjectionPermissionResultData The resultData returned from launching
171183
* [MediaProjectionManager.createScreenCaptureIntent()](https://developer.android.com/reference/android/media/projection/MediaProjectionManager#createScreenCaptureIntent()).
184+
* @param options The capture options to use for this track, or [Room.videoTrackCaptureDefaults] if none is passed.
185+
* @param videoProcessor A video processor to attach to this track that can modify the frames before publishing.
172186
*/
173187
fun createScreencastTrack(
174188
name: String = "",
@@ -201,6 +215,11 @@ internal constructor(
201215
* If set to enabled, creates and publishes a camera video track if not already done, and starts the camera.
202216
*
203217
* If set to disabled, mutes and stops the camera.
218+
*
219+
* This will use capture and publish default options from [Room].
220+
*
221+
* @see Room.videoTrackCaptureDefaults
222+
* @see Room.videoTrackPublishDefaults
204223
*/
205224
suspend fun setCameraEnabled(enabled: Boolean) {
206225
setTrackEnabled(Track.Source.CAMERA, enabled)
@@ -210,6 +229,11 @@ internal constructor(
210229
* If set to enabled, creates and publishes a microphone audio track if not already done, and unmutes the mic.
211230
*
212231
* If set to disabled, mutes the mic.
232+
*
233+
* This will use capture and publish default options from [Room].
234+
*
235+
* @see Room.audioTrackCaptureDefaults
236+
* @see Room.audioTrackPublishDefaults
213237
*/
214238
suspend fun setMicrophoneEnabled(enabled: Boolean) {
215239
setTrackEnabled(Track.Source.MICROPHONE, enabled)
@@ -220,9 +244,13 @@ internal constructor(
220244
*
221245
* If set to disabled, unpublishes the screenshare video track.
222246
*
247+
* This will use capture and publish default options from [Room].
248+
*
223249
* @param mediaProjectionPermissionResultData The resultData returned from launching
224250
* [MediaProjectionManager.createScreenCaptureIntent()](https://developer.android.com/reference/android/media/projection/MediaProjectionManager#createScreenCaptureIntent()).
225251
* @throws IllegalArgumentException if attempting to enable screenshare without [mediaProjectionPermissionResultData]
252+
* @see Room.videoTrackCaptureDefaults
253+
* @see Room.videoTrackPublishDefaults
226254
*/
227255
suspend fun setScreenShareEnabled(
228256
enabled: Boolean,
@@ -295,6 +323,9 @@ internal constructor(
295323

296324
/**
297325
* Publishes an audio track.
326+
*
327+
* @param track The track to publish.
328+
* @param options The publish options to use, or [Room.audioTrackPublishDefaults] if none is passed.
298329
*/
299330
suspend fun publishAudioTrack(
300331
track: LocalAudioTrack,
@@ -335,6 +366,9 @@ internal constructor(
335366

336367
/**
337368
* Publishes an video track.
369+
*
370+
* @param track The track to publish.
371+
* @param options The publish options to use, or [Room.videoTrackPublishDefaults] if none is passed.
338372
*/
339373
suspend fun publishVideoTrack(
340374
track: LocalVideoTrack,

0 commit comments

Comments
 (0)