tencent cloud

Tencent Real-Time Communication

ScreenShareStore

下载
聚焦模式
字号
最后更新时间: 2026-11-11 22:11:14

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
StateFlow<DeviceStatus>
Screen sharing status.

API List

Function
Description
Singleton object.
Start screen sharing.
Stop screen sharing.
reset
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
StateFlow<DeviceStatus>
Screen sharing status.

Usage Example

// Get singleton instance
val store = ScreenShareStore.shared()
// Subscribe to state changes
lifecycleScope.launch {
store.screenShareState.screenStatus.collect { status ->
println("Screen sharing status: $status")
}
}
// Start screen sharing
store.startScreenShare()
// Stop screen sharing
store.stopScreenShare()

帮助和支持

本页内容是否解决了您的问题?

填写满意度调查问卷,共创更好文档体验。

文档反馈