Description
LocalScreenTrack requests screen capture permission, starts and stops screen capture, and can be used as the input track for publishLocalVideo.
LocalScreenTrack methods
setEvent(e)
null when the screen is destroyed to release the reference between the screen and the track.
Parameters:
e:RTCScreenStateEvent?, the screen capture state callback implementation;nullclears the callback. Returns: None (Unit).
request(result)
Intent returned on successful authorization must be passed to startCapture.Parameters:
result:(Boolean, Intent?) -> Unit, the permission request result callback. Returns: None (Unit).
setRecordNotification(smallIcon, title, desc, buttonText)
Parameters:
smallIcon:Int, the resource ID of the notification’s small icon.title:String?, the notification title; can benull.desc:String?, the notification description; can benull.buttonText:String?, the notification button text; can benull. Returns: None (Unit).
startCapture(intent, resultListener)
onSuccess() only means the SDK accepted the request, not that capture is established; the actual state is reported through RTCScreenStateEvent. The result callback isn’t guaranteed to run on the main thread.
Parameters:
intent:Intent, the screen capture authorization data returned by therequestsuccess callback.resultListener:RTCResultListener?, whether the start request was accepted;onFail(code)means the request wasn’t accepted, and no screen lifecycle event is produced for it. Can benull. Returns: None (Unit).
stopCapture()
Parameters: None.
Returns: None (
Unit).
Rendering methods inherited from VideoTrack
Views areVcsPlayerGlTextureView / VcsPlayerGlSurfaceView from the cn.seastart.rtc.media.original.render package; for display control and lifecycle, see Video rendering.
addPlayView(view)
VcsPlayerGlTextureView / VcsPlayerGlSurfaceView are supported.Parameters:
view:View, the render view. Returns:Boolean;trueif the view was added,falseif the type is unsupported or the view was already added.
replacePlayView(views)
Parameters:
views:MutableList<View>, the render views; onlyVcsPlayerGlTextureView/VcsPlayerGlSurfaceVieware supported. Returns: None (Unit).
removePlayView(view)
Parameters:
view:View, the target render view. Returns: None (Unit).
removeAllPlayView()
Parameters: None.
Returns: None (
Unit).
RTCScreenStateEvent callback interface
RTCScreenStateEvent is the screen capture state callback interface, registered through setEvent(e).
onScreenCaptureStateChanged(state, args)
RTCResultListener of startCapture.
Parameters:
state:ScreenCaptureState, one ofSTART,STOP, andERROR; for enum values, see Enums.args:String?, extra information; can benull. Returns: None (Unit).
Since 2.0.29,onScreenRecordStateChanged(ScreenRecordState, ...)has been replaced byonScreenCaptureStateChanged(ScreenCaptureState, ...), andScreenRecordState.AUDIO_ERRORis no longer available.