LocalScreencastVideoTrack

class LocalScreencastVideoTrack @AssistedInject constructor(@Assisted capturer: VideoCapturer, @Assisted source: VideoSource, @Assisted name: String, @Assisted options: LocalVideoTrackOptions, @Assisted rtcTrack: VideoTrack, @Assisted mediaProjectionCallback: LocalScreencastVideoTrack.MediaProjectionCallback, peerConnectionFactory: PeerConnectionFactory, context: Context, eglBase: EglBase, defaultsManager: DefaultsManager, videoTrackFactory: LocalVideoTrack.Factory) : LocalVideoTrack

Constructors

Link copied to clipboard
@AssistedInject
constructor(@Assisted capturer: VideoCapturer, @Assisted source: VideoSource, @Assisted name: String, @Assisted options: LocalVideoTrackOptions, @Assisted rtcTrack: VideoTrack, @Assisted mediaProjectionCallback: LocalScreencastVideoTrack.MediaProjectionCallback, peerConnectionFactory: PeerConnectionFactory, context: Context, eglBase: EglBase, defaultsManager: DefaultsManager, videoTrackFactory: LocalVideoTrack.Factory)

Types

Link copied to clipboard
object Companion
Link copied to clipboard
@AssistedFactory
interface Factory
Link copied to clipboard

Needed to deal with circular dependency.

Properties

Link copied to clipboard
var capturer: VideoCapturer
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
@FlowObservable
@get:FlowObservable
var options: LocalVideoTrackOptions
Link copied to clipboard
open override var rtcTrack: VideoTrack
Link copied to clipboard
var sid: String?
Link copied to clipboard
Link copied to clipboard

Functions

Link copied to clipboard
open override fun addRenderer(renderer: VideoSink)

Add a VideoSink that will receive frames.

Link copied to clipboard
open override fun dispose()

Disposes the track. LiveKit will generally take care of disposing tracks for you.

Link copied to clipboard
suspend fun getRTCStats(): RTCStatsReport?

Return the RTCStatsReport for this track, or null if none is available.

fun getRTCStats(callback: RTCStatsCollectorCallback)

Calls the callback with the RTCStatsReport for this track, or null if none is available.

Link copied to clipboard
open override fun removeRenderer(renderer: VideoSink)

Remove a previously added VideoSink.

Link copied to clipboard
fun restartTrack(options: LocalVideoTrackOptions = defaultsManager.videoTrackCaptureDefaults.copy())

Restart a track with new options.

Link copied to clipboard
fun setDeviceId(deviceId: String)

If this is a camera track, switches to the new camera determined by deviceId

Link copied to clipboard
open fun start()

Starts the track.

Link copied to clipboard
open fun startCapture()

Starts the capturer with the capture params contained in options.

Link copied to clipboard
suspend fun startForegroundService(notificationId: Int?, notification: Notification?)

A foreground service is generally required prior to startCapture for screen capture. This method starts up a helper foreground service that only serves to display a notification while capturing. This foreground service will automatically stop upon the end of screen capture.

Link copied to clipboard
open override fun stop()

Stops the track.

Link copied to clipboard
open fun stopCapture()

Stops the capturer.

Link copied to clipboard
fun switchCamera(deviceId: String? = null, position: CameraPosition? = null)

Switch to a different camera. Only works if this track is backed by a camera capturer.