Mediasfu Parameters
Central parameter management class for MediaSFU SDK.
This class provides a simplified implementation of the core parameter management functionality needed by the MediaSFU SDK. It manages the global state and provides update functions for all state changes.
Key Features:
Manages WebRTC state (transports, producers, consumers)
Handles socket connections and events
Manages UI state and participant data
Provides update functions for all state changes
Usage:
val parameters = MediasfuParameters()
// Use in consumer methods
val options = ConnectIpsOptions(
consumeSockets = emptyList(),
remIP = listOf("100.122.1.1"),
apiUserName = "user",
apiToken = "token",
parameters = parameters
)
val result = connectIps(options)State Management:
All state is mutable and can be updated via update functions
State changes trigger callbacks for UI updates
Thread-safe access through coroutines
Properties
Callback to request screen capture permission. On Android, this should request MediaProjection permission and return mapOf("resultCode" to resultCode, "data" to data) on success, or null on denial.
Callback to stop the screen capture foreground service. Called when screen sharing is stopped.
Functions
Auto-adjusts layout parameters.
Changes video streams configuration.
Updates the active sounds list.
Updates the admin ID stream.
Updates the admin name stream.
Updates the admin video ID.
Updates the all video streams list.
Updates whether background has changed.
Updates the canvas stream for whiteboard video capture.
Updates the canvas whiteboard reference.
Updates the background modal visibility.
Updates configure whiteboard modal visibility.
Updates the user level and triggers related state changes.
Updates whiteboard modal visibility.
Updates the keep background state.
Updates the last update timestamp.
Updates the member name.
Updates the new limited streams list.
Updates the new limited streams IDs list.
Updates the nForReadjust value.
Updates the old all streams list.
Updates the participants list.
Updates the processed stream (with virtual background applied).
Updates the redo stack for whiteboard.
Updates the room name and triggers related state changes.
Updates the screen share ID stream.
Updates the screen share name stream.
Updates the selected virtual background.
Updates the shapes list on the whiteboard.
Updates the shared state.
Updates the streams list.
Updates the undo stack for whiteboard.
Updates the update date state timestamp.
Updates whether to use image background on whiteboard.
Updates whiteboard ended state.
Updates whiteboard started state.
Updates the whiteboard users list.
Updates the you-you stream list.