TRTCVideoStreamType
parameter to TRTCVideoStreamTypeSub
when calling the startScreenCapture
API. To play substream video, call startRemoteSubStreamView
.TRTCVideoStreamType
parameter to TRTCVideoStreamTypeBig
when calling the startScreenCapture
API.iOS | Android | macOS | Windows | Electron | Chrome |
✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
TRTCScreenCaptureSourceInfo
object.TRTCScreenCaptureSourceTypeWindow
, while that of the desktop is TRTCScreenCaptureSourceTypeScreen
.type
, for each TRTCScreenCaptureSourceInfo
object:Parameter | Type | Description |
type | TRTCScreenCaptureSourceType | Capturing source type, which may be window or screen |
sourceId | NSString | Capturing source ID. If a window is captured, the value of this parameter is the window handle. If a screen is captured, the value of this parameter is the screen ID. |
sourceName | NSString | Window name. If a screen is captured, the value of this parameter is Screen0 , Screen1 , and so on. |
extInfo | NSDictionary | Extra information |
Thumbnail | NSImage | Window thumbnail |
Icon | NSImage | Window icon |
type
is TRTCScreenCaptureSourceTypeScreen
and setting rect
to {0, 0, 0, 0}. This mode is supported when you split the screen onto multiple monitors.type
is TRTCScreenCaptureSourceTypeScreen
and setting rect
to a non-null value, such as {100, 100, 300, 300}.type
is TRTCScreenCaptureSourceTypeWindow
and setting rect
to {0, 0, 0, 0}.capturesCursor
: specifies whether to capture the cursor.highlight
: specifies whether to highlight the window being shared and remind the user to move the window when it is covered. The relevant UI design is implemented within the SDK./*** 7.6 **Screen Sharing** Start screen sharing* @param view Parent control of the rendering control*/- (void)startScreenCapture:(NSView *)view;/*** 7.7 **Screen Sharing** Stop screen sharing* @return `0`: successful; negative number: failed*/- (int)stopScreenCapture;/*** 7.8 **Screen Sharing** Pause screen sharing* @return `0`: successful; negative number: failed*/- (int)pauseScreenCapture;/*** 7.9 **Screen Sharing** Resume screen sharing** @return `0`: successful; negative number: failed*/- (int)resumeScreenCapture;
Clarity | Resolution | Frame Rate | Bitrate |
FHD | 1920 × 1080 | 10 | 800 Kbps |
HD | 1280 × 720 | 10 | 600 Kbps |
SD | 960 × 720 | 10 | 400 Kbps |
TRTCCloudDelegate
.
Users who want to watch the shared screen can start rendering the substream image of the remote user by calling the startRemoteSubStreamView API.TRTCCloudDelegate
.
Users who want to watch the shared screen can start rendering the primary stream of the remote user by calling the startRemoteView API.//Sample code: watch the shared screen- (void)onUserSubStreamAvailable:(NSString *)userId available:(BOOL)available {if (available) {[self.trtcCloud startRemoteSubStreamView:userId view:self.capturePreviewWindow.contentView];} else {[self.trtcCloud stopRemoteSubStreamView:userId];}}
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.
Was this page helpful?