click Screen Share
Handles the action for the screen button, including starting and stopping screen sharing.
This function performs the following actions:
Checks if the room is audio-only or a demo room and shows alerts accordingly.
Toggles screen sharing based on the current status.
Checks for admin restrictions and permissions before starting screen sharing.
Sends requests to the host for screen sharing approval if necessary.
Updates the UI and state based on the action taken.
Example:
val options = ClickScreenShareOptions(
parameters = object : ClickScreenShareParameters {
override val showAlert: ShowAlert? = showAlertFunction
override val roomName: String = "room123"
override val member: String = "John Doe"
override val socket: Socket? = socketInstance
override val islevel: String = "1"
override val youAreCoHost: Boolean = false
override val adminRestrictSetting: Boolean = false
override val audioSetting: String = "allow"
override val videoSetting: String = "allow"
override val screenshareSetting: String = "allow"
override val chatSetting: String = "allow"
override val screenAction: Boolean = false
override val screenAlreadyOn: Boolean = false
override val screenRequestState: String? = null
override val screenRequestTime: Long? = Clock.System.now().toEpochMilliseconds()
override val audioOnlyRoom: Boolean = false
override val updateRequestIntervalSeconds: Int = 60
override val updateScreenRequestState: (String?) -> Unit = setScreenRequestState
override val updateScreenAlreadyOn: (Boolean) -> Unit = setScreenAlreadyOn
override val checkPermission: CheckPermissionType = checkPermissionFunction
override val checkScreenShare: CheckScreenShareType = checkScreenShareFunction
override val stopShareScreen: StopShareScreenType = stopShareScreenFunction
// Other properties...
}
)
clickScreenShare(options)Content copied to clipboard