davidliu
Committed by GitHub

Documentation updates for LocalParticipant methods (#510)

  1 +---
  2 +"client-sdk-android": patch
  3 +---
  4 +
  5 +Documentation updates for LocalParticipant methods
@@ -30,6 +30,7 @@ import io.livekit.android.events.ParticipantEvent @@ -30,6 +30,7 @@ import io.livekit.android.events.ParticipantEvent
30 import io.livekit.android.room.ConnectionState 30 import io.livekit.android.room.ConnectionState
31 import io.livekit.android.room.DefaultsManager 31 import io.livekit.android.room.DefaultsManager
32 import io.livekit.android.room.RTCEngine 32 import io.livekit.android.room.RTCEngine
  33 +import io.livekit.android.room.Room
33 import io.livekit.android.room.TrackBitrateInfo 34 import io.livekit.android.room.TrackBitrateInfo
34 import io.livekit.android.room.isSVCCodec 35 import io.livekit.android.room.isSVCCodec
35 import io.livekit.android.room.track.DataPublishReliability 36 import io.livekit.android.room.track.DataPublishReliability
@@ -110,6 +111,8 @@ internal constructor( @@ -110,6 +111,8 @@ internal constructor(
110 /** 111 /**
111 * Creates an audio track, recording audio through the microphone with the given [options]. 112 * Creates an audio track, recording audio through the microphone with the given [options].
112 * 113 *
  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.
113 * @exception SecurityException will be thrown if [Manifest.permission.RECORD_AUDIO] permission is missing. 116 * @exception SecurityException will be thrown if [Manifest.permission.RECORD_AUDIO] permission is missing.
114 */ 117 */
115 fun createAudioTrack( 118 fun createAudioTrack(
@@ -124,6 +127,11 @@ internal constructor( @@ -124,6 +127,11 @@ internal constructor(
124 * 127 *
125 * This method will call [VideoCapturer.initialize] and handle the lifecycle of 128 * This method will call [VideoCapturer.initialize] and handle the lifecycle of
126 * [SurfaceTextureHelper]. 129 * [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.
127 */ 135 */
128 fun createVideoTrack( 136 fun createVideoTrack(
129 name: String = "", 137 name: String = "",
@@ -146,6 +154,9 @@ internal constructor( @@ -146,6 +154,9 @@ internal constructor(
146 /** 154 /**
147 * Creates a video track, recording video through the camera with the given [options]. 155 * Creates a video track, recording video through the camera with the given [options].
148 * 156 *
  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.
149 * @exception SecurityException will be thrown if [Manifest.permission.CAMERA] permission is missing. 160 * @exception SecurityException will be thrown if [Manifest.permission.CAMERA] permission is missing.
150 */ 161 */
151 fun createVideoTrack( 162 fun createVideoTrack(
@@ -167,8 +178,11 @@ internal constructor( @@ -167,8 +178,11 @@ internal constructor(
167 /** 178 /**
168 * Creates a screencast video track. 179 * Creates a screencast video track.
169 * 180 *
  181 + * @param name The name of the track.
170 * @param mediaProjectionPermissionResultData The resultData returned from launching 182 * @param mediaProjectionPermissionResultData The resultData returned from launching
171 * [MediaProjectionManager.createScreenCaptureIntent()](https://developer.android.com/reference/android/media/projection/MediaProjectionManager#createScreenCaptureIntent()). 183 * [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.
172 */ 186 */
173 fun createScreencastTrack( 187 fun createScreencastTrack(
174 name: String = "", 188 name: String = "",
@@ -201,6 +215,11 @@ internal constructor( @@ -201,6 +215,11 @@ internal constructor(
201 * If set to enabled, creates and publishes a camera video track if not already done, and starts the camera. 215 * If set to enabled, creates and publishes a camera video track if not already done, and starts the camera.
202 * 216 *
203 * If set to disabled, mutes and stops the camera. 217 * 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
204 */ 223 */
205 suspend fun setCameraEnabled(enabled: Boolean) { 224 suspend fun setCameraEnabled(enabled: Boolean) {
206 setTrackEnabled(Track.Source.CAMERA, enabled) 225 setTrackEnabled(Track.Source.CAMERA, enabled)
@@ -210,6 +229,11 @@ internal constructor( @@ -210,6 +229,11 @@ internal constructor(
210 * If set to enabled, creates and publishes a microphone audio track if not already done, and unmutes the mic. 229 * If set to enabled, creates and publishes a microphone audio track if not already done, and unmutes the mic.
211 * 230 *
212 * If set to disabled, mutes the mic. 231 * 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
213 */ 237 */
214 suspend fun setMicrophoneEnabled(enabled: Boolean) { 238 suspend fun setMicrophoneEnabled(enabled: Boolean) {
215 setTrackEnabled(Track.Source.MICROPHONE, enabled) 239 setTrackEnabled(Track.Source.MICROPHONE, enabled)
@@ -220,9 +244,13 @@ internal constructor( @@ -220,9 +244,13 @@ internal constructor(
220 * 244 *
221 * If set to disabled, unpublishes the screenshare video track. 245 * If set to disabled, unpublishes the screenshare video track.
222 * 246 *
  247 + * This will use capture and publish default options from [Room].
  248 + *
223 * @param mediaProjectionPermissionResultData The resultData returned from launching 249 * @param mediaProjectionPermissionResultData The resultData returned from launching
224 * [MediaProjectionManager.createScreenCaptureIntent()](https://developer.android.com/reference/android/media/projection/MediaProjectionManager#createScreenCaptureIntent()). 250 * [MediaProjectionManager.createScreenCaptureIntent()](https://developer.android.com/reference/android/media/projection/MediaProjectionManager#createScreenCaptureIntent()).
225 * @throws IllegalArgumentException if attempting to enable screenshare without [mediaProjectionPermissionResultData] 251 * @throws IllegalArgumentException if attempting to enable screenshare without [mediaProjectionPermissionResultData]
  252 + * @see Room.videoTrackCaptureDefaults
  253 + * @see Room.videoTrackPublishDefaults
226 */ 254 */
227 suspend fun setScreenShareEnabled( 255 suspend fun setScreenShareEnabled(
228 enabled: Boolean, 256 enabled: Boolean,
@@ -295,6 +323,9 @@ internal constructor( @@ -295,6 +323,9 @@ internal constructor(
295 323
296 /** 324 /**
297 * Publishes an audio track. 325 * 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.
298 */ 329 */
299 suspend fun publishAudioTrack( 330 suspend fun publishAudioTrack(
300 track: LocalAudioTrack, 331 track: LocalAudioTrack,
@@ -335,6 +366,9 @@ internal constructor( @@ -335,6 +366,9 @@ internal constructor(
335 366
336 /** 367 /**
337 * Publishes an video track. 368 * 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.
338 */ 372 */
339 suspend fun publishVideoTrack( 373 suspend fun publishVideoTrack(
340 track: LocalVideoTrack, 374 track: LocalVideoTrack,