@@ -30,6 +30,7 @@ import io.livekit.android.events.ParticipantEvent
30
30
import io.livekit.android.room.ConnectionState
31
31
import io.livekit.android.room.DefaultsManager
32
32
import io.livekit.android.room.RTCEngine
33
+ import io.livekit.android.room.Room
33
34
import io.livekit.android.room.TrackBitrateInfo
34
35
import io.livekit.android.room.isSVCCodec
35
36
import io.livekit.android.room.track.DataPublishReliability
@@ -110,6 +111,8 @@ internal constructor(
110
111
/* *
111
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
116
* @exception SecurityException will be thrown if [Manifest.permission.RECORD_AUDIO] permission is missing.
114
117
*/
115
118
fun createAudioTrack (
@@ -124,6 +127,11 @@ internal constructor(
124
127
*
125
128
* This method will call [VideoCapturer.initialize] and handle the lifecycle of
126
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
136
fun createVideoTrack (
129
137
name : String = "",
@@ -146,6 +154,9 @@ internal constructor(
146
154
/* *
147
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
160
* @exception SecurityException will be thrown if [Manifest.permission.CAMERA] permission is missing.
150
161
*/
151
162
fun createVideoTrack (
@@ -167,8 +178,11 @@ internal constructor(
167
178
/* *
168
179
* Creates a screencast video track.
169
180
*
181
+ * @param name The name of the track.
170
182
* @param mediaProjectionPermissionResultData The resultData returned from launching
171
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
187
fun createScreencastTrack (
174
188
name : String = "",
@@ -201,6 +215,11 @@ internal constructor(
201
215
* If set to enabled, creates and publishes a camera video track if not already done, and starts the camera.
202
216
*
203
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
224
suspend fun setCameraEnabled (enabled : Boolean ) {
206
225
setTrackEnabled(Track .Source .CAMERA , enabled)
@@ -210,6 +229,11 @@ internal constructor(
210
229
* If set to enabled, creates and publishes a microphone audio track if not already done, and unmutes the mic.
211
230
*
212
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
238
suspend fun setMicrophoneEnabled (enabled : Boolean ) {
215
239
setTrackEnabled(Track .Source .MICROPHONE , enabled)
@@ -220,9 +244,13 @@ internal constructor(
220
244
*
221
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
249
* @param mediaProjectionPermissionResultData The resultData returned from launching
224
250
* [MediaProjectionManager.createScreenCaptureIntent()](https://developer.android.com/reference/android/media/projection/MediaProjectionManager#createScreenCaptureIntent()).
225
251
* @throws IllegalArgumentException if attempting to enable screenshare without [mediaProjectionPermissionResultData]
252
+ * @see Room.videoTrackCaptureDefaults
253
+ * @see Room.videoTrackPublishDefaults
226
254
*/
227
255
suspend fun setScreenShareEnabled (
228
256
enabled : Boolean ,
@@ -295,6 +323,9 @@ internal constructor(
295
323
296
324
/* *
297
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
330
suspend fun publishAudioTrack (
300
331
track : LocalAudioTrack ,
@@ -335,6 +366,9 @@ internal constructor(
335
366
336
367
/* *
337
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
373
suspend fun publishVideoTrack (
340
374
track : LocalVideoTrack ,
0 commit comments