ScreenShareStore
Introduction
ScreenShareStore provides a complete set of screen sharing APIs, including full-screen sharing on mobile, and screen / window source enumeration and targeted sharing on desktop (Win/Mac).Notice:
Use ScreenShareStore.shared singleton to get the
ScreenShareStore instance. Do not attempt to initialize directly.Note:
Screen sharing state updates are delivered through the screenShareState publisher. Subscribe to it to receive real-time updates about screen sharing status.
Features
Screen Sharing: Start and stop screen sharing, with support for iOS App Group and desktop capture property configuration.
Source Enumeration: Enumerate shareable screens and application windows with thumbnails and icons for building source-picker UI (desktop only).
State Subscription: Real-time subscription to screen sharing state changes.
Subscribable Data
ScreenShareState fields are described below:
Property | Type | Description |
screenStatus | Screen sharing status. |
API List
Function | Description |
Singleton object. | |
Start screen sharing. | |
Stop screen sharing. | |
Reset to default state. |
Getting Instance
ScreenShareStore.shared
Singleton object.
Screen Sharing
startScreenShare
Start screen sharing.
abstract fun startScreenShare()
Version
Supported since version 3.5.
stopScreenShare
Stop screen capture.
abstract fun stopScreenShare()
Version
Supported since version 3.5.
Reset
reset
Reset to default state.
abstract fun reset()
Version
Supported since version 3.5.
Data Structures
ScreenShareState
Screen sharing state.
Property | Type | Description |
screenStatus | Screen sharing status. |
Usage Example
// Get singleton instanceval store = ScreenShareStore.shared()// Subscribe to state changeslifecycleScope.launch {store.screenShareState.screenStatus.collect { status ->println("Screen sharing status: $status")}}// Start screen sharingstore.startScreenShare()// Stop screen sharingstore.stopScreenShare()
