tencent cloud

Tencent Real-Time Communication

Release Notes and Announcements
Release Notes
Recent Product Announcement
TRTC Live (TUILiveKit) Product Launch Announcement
TRTC Conference Official Editions Launched
The commercial version of Conference is coming soon
Terms and Conditions Applicable to $9.9 Starter Package
Rules for the "First Subscription $100 Discount" Promotion
Announcement on the Start of Beta Testing for Multi-person Audio and Video Conference
TRTC Call Official Editions Launched
License Required for Video Playback in New Version of LiteAV SDK
TRTC to Offer Monthly Packages
Product Introduction
Overview
Concepts
Features
Strengths
Use Cases
Performance Statistics
Tencent RTC Quickplay: Experience Ultimate Real-Time Audio and Video Interaction!
Purchase Guide
Billing Overview
Free Minutes
Monthly subscription
Pay-as-you-go
TRTC Overdue and Suspension Policy
FAQs
Refund Instructions
User Tutorial
Free Demo
Call
Overview
Activate the Service
Run Demo
Integration
Offline Call Push
Conversational Chat
On-Cloud Recording
AI Noise Reduction
UI Customization
Calls integration to Chat
Additional Features
No UI Integration
Server APIs
Client APIs
Solution
ErrorCode
Release Notes
FAQs
Conference
Overview(TUIRoomKit)
Activate the Service (TUIRoomKit)
Run Demo(TUIRoomKit)
Integration(TUIRoomKit)
Screen Sharing (TUIRoomKit)
Schedule a meeting (TUIRoomKit)
In-meeting Call (TUIRoomKit)
UI Customization(TUIRoomKit)
Virtual Background (TUIRoomKit)
Conference Control (TUIRoomKit)
Cloud Recording (TUIRoomKit)
AI Noise Reduction (TUIRoomKit)
In-Conference Chat (TUIRoomKit)
Robot Streaming (TUIRoomKit)
Enhanced Features (TUIRoomKit)
Client APIs (TUIRoomKit)
Server APIs (TUIRoomKit)
FAQs (TUIRoomKit)
Error Code (TUIRoomKit)
SDK Update Log (TUIRoomKit)
Live
Billing of Video Live Component
Overview
Activating the Service (TUILiveKit)
Run Demo
No UI Integration
UI Customization
Live Broadcast Monitoring
Video Live Streaming
Voice Chat Room
Advanced Features
Client APIs
Server APIs
Error Codes
Release Notes
FAQs
RTC Engine
Activate Service
SDK Download
API Examples
Usage Guidelines
API Reference Manual
Advanced Features
AI Integration
Overview
Configure MCP Server
Install Skills
Integration Guide
FAQ
RTC RESTFUL API
History
Introduction
API Category
Room Management APIs
Stream mixing and relay APIs
On-cloud recording APIs
Data Monitoring APIs
Pull stream Relay Related interface
Web Record APIs
AI Service APIs
Cloud Slicing APIs
Cloud Moderation APIs
Making API Requests
Call Quality Monitoring APIs
Usage Statistics APIs
Data Types
Appendix
Error Codes
Console Guide
Application Management
Package Management
Usage Statistics
Monitoring Dashboard
Development Assistance
Solution
Real-Time Chorus
FAQs
Migration Guide
Billing
Features
UserSig
Firewall Restrictions
How to Downsize Installation Package
Android and iOS
Web
Flutter
Electron
TRTCCalling for Web
Audio and Video Quality
Others
Legacy Documentation
RTC RoomEngine SDK(Old)
Integrating TUIRoom (Web)
Integrating TUIRoom (Android)
Integrating TUIRoom (iOS)
Integrating TUIRoom (Flutter)
Integrating TUIRoom (Electron)
TUIRoom APIs
On-Cloud Recording and Playback (Old)
RTC Analytics Monthly Packages (Previous Version)
Protocols and Policies
Compliance
Security White Paper
Notes on Information Security
Service Level Agreement
Apple Privacy Policy: PrivacyInfo.xcprivacy
TRTC Policy
Privacy Policy
Data Processing And Security Agreement
Glossary

Windows

PDF
Focus Mode
Font Size
Last updated: 2023-09-28 11:43:41
This document describes how to share the screen. Currently, a TRTC room can have only one screen sharing stream at a time.
TRTC supports screen sharing in primary stream and substream modes on Windows.
Substream sharing In TRTC, you can share the screen via a dedicated stream called the substream. In substream sharing, an anchor publishes camera video and screen sharing images at the same time. This is the scheme used by VooV Meeting. You can enable substream sharing by setting the TRTCVideoStreamType parameter to TRTCVideoStreamTypeSub when calling the startScreenCapture API.
Primary stream sharing In TRTC, the image from the user’s camera is published via the primary stream (bigstream). In primary stream sharing, an anchor publishes screen sharing images via the primary stream. Because there is only one stream, an anchor cannot publish both camera video and screen sharing images. You can enable this mode by setting the TRTCVideoStreamType parameter to TRTCVideoStreamTypeBig when calling the startScreenCapture API.

APIs

Description
C++
C#
Electron
Selects a sharing source
selectScreenCaptureTarget
Starts screen sharing
startScreenCapture
Pauses screen sharing
pauseScreenCapture
Resumes screen sharing
resumeScreenCapture
Ends screen sharing
stopScreenCapture

Getting Sharing Sources

You can call getScreenCaptureSources to get a list of sharable sources, which is returned via the response parameter sourceInfoList.
explain
On Windows, the desktop also counts as a window. When two monitors are used, each monitor corresponds to a desktop window. The list returned via getScreenCaptureSources includes desktop windows.
Based on the obtained window information, you can display a list of sharable sources on the UI for users to choose from.

Starting Screen Sharing

After selecting a sharing source, you can call the startScreenCapture API to start screen sharing.
During screen sharing, you can call selectScreenCaptureTarget to change the sharing source.
The difference between pauseScreenCapture and stopScreenCapture is that pauseScreenCapture pauses screen capturing and displays the image at the moment it is paused. Remote users see the paused video image until screen capturing is resumed.

Setting Video Quality

You can use the setSubStreamEncoderParam API to set the video quality of screen sharing, including resolution, bitrate, and frame rate. We recommend the following settings:
Clarity
Resolution
Frame Rate
Bitrate
FHD
1920 x 1080
10
800 Kbps
HD
1280 x 720
10
600 Kbps
SD
960 x 720
10
400 Kbps

Watching Shared Screen

When a user in a room starts screen sharing, the screen will be shared through a substream, and other users in the room will be notified through onUserSubStreamAvailable in ITRTCCloudCallback. Users who want to view the shared screen can start rendering the substream image of the remote user by calling the startRemoteView API.
//Sample code: Watch the shared screen
void CTRTCCloudSDK::onUserSubStreamAvailable(const char * userId, bool available) {
LINFO(L"onUserSubStreamAvailable userId[%s] available[%d]\\n", UTF82Wide(userId).c_str(), available);
liteav::ITRTCCloud* trtc_cloud_ = getTRTCShareInstance();
if (available) {
trtc_cloud_->startRemoteView(userId, liteav::TRTCVideoStreamTypeSub, hWnd);
} else {
trtc_cloud_->stopRemoteView(userId, liteav::TRTCVideoStreamTypeSub);
}
}

FAQs

1. Can there be multiple channels of screen sharing streams in a room at the same time?

Currently, a TRTC room can have only one screen sharing stream at a time.

2. When a specified window (SourceTypeWindow) is shared, if the window size changes, will the resolution of the video stream change accordingly?

By default, the SDK automatically adjusts encoding parameters according to the size of the shared window. If you want a fixed resolution, call the setSubStreamEncoderParam API to set encoding parameters for screen sharing or specify the parameters when calling the startScreenCapture API.

Help and Support

Was this page helpful?

Help us improve! Rate your documentation experience in 5 mins.

Feedback