Video SDK for iOS API Reference
Loading...
Searching...
No Matches
ZoomVideoSDKVideoCanvas Class Reference

The video canvas is the display area of the video streams on the user’s local device. To instantiate a local video canvas instance and show the video stream of a user, simply initialize the ZoomVideoSDKVideoCanvas object, subscribe the userId of a specific user, and add it to your UIView. More...

#include <ZoomVideoSDKVideoCanvas.h>

Inherits NSObject.

Instance Methods

(ZoomVideoSDKVideoType- canvasType
 Gets the canvas type.
 
(ZoomVideoSDKVideoStatus *_Nullable) - videoStatus
 Gets the user's video status.
 
(ZoomVideoSDKShareStatus *_Nullable) - shareStatus
 Gets the user's share status.
 
(ZoomVideoSDKError- subscribeWithView:aspectMode:andResolution:
 Subscribes to the user's video or share view.
 
(ZoomVideoSDKError- subscribeWithPiPView:aspectMode:andResolution:
 Subscribes to the user's video or share view in Picture-in-Picture mode for video calls.
 
(ZoomVideoSDKError- unSubscribeWithView:
 Unsubscribes from video or share data.
 
(ZoomVideoSDKError- setAspectMode:toView:
 Sets the video aspect mode.
 
(ZoomVideoSDKError- setResolution:toView:
 Sets the video resolution.
 
(UIImage *_Nullable) - takeSnapshot:
 Captures a snapshot of the current video frame from the specified UIView and returns it as a UIImage. This method captures the current frame being displayed in the video or share canvas.
 

Detailed Description

The video canvas is the display area of the video streams on the user’s local device. To instantiate a local video canvas instance and show the video stream of a user, simply initialize the ZoomVideoSDKVideoCanvas object, subscribe the userId of a specific user, and add it to your UIView.

Definition at line 12 of file ZoomVideoSDKVideoCanvas.h.

Method Documentation

◆ canvasType

- (ZoomVideoSDKVideoType) canvasType

Gets the canvas type.

Returns
If the function succeeds, it returns the canvas type. Otherwise, this function returns an error.

◆ setAspectMode:toView:

- (ZoomVideoSDKError) setAspectMode: (ZoomVideoSDKVideoAspect) aspect
toView: (UIView *_Nullable) view 

Sets the video aspect mode.

Parameters
aspectThe aspect mode of video.
viewThe UIView object to render video.
Returns
If the function succeeds, it returns Errors_Success. Otherwise, this function returns an error.

◆ setResolution:toView:

- (ZoomVideoSDKError) setResolution: (ZoomVideoSDKVideoResolution) resolution
toView: (UIView *_Nullable) view 

Sets the video resolution.

Parameters
resolutionThe video resolution. Valid only for video canvas.
viewThe UIView object to render video.
Returns
If the function succeeds, it returns Errors_Success. Otherwise, this function returns an error.

◆ shareStatus

- (ZoomVideoSDKShareStatus *_Nullable) shareStatus

Gets the user's share status.

Returns
If the function succeeds, it returns a ZoomVideoSDKShareStatus object. Otherwise, this function fails and returns nil.
Warning
This interface is marked as deprecated, then it will be replaced by shareStatus (ZoomVideoSDKRawDataPipe) and shareStatus.

◆ subscribeWithPiPView:aspectMode:andResolution:

- (ZoomVideoSDKError) subscribeWithPiPView: (UIView *_Nullable) view
aspectMode: (ZoomVideoSDKVideoAspect) aspect
andResolution: (ZoomVideoSDKVideoResolution) resolution 

Subscribes to the user's video or share view in Picture-in-Picture mode for video calls.

Parameters
viewThe UIView object that you need to render data.
aspectThe render's aspect mode.
resolutionThe render's resolution. Valid only for video canvas.
Returns
If the function succeeds, it returns Errors_Success. Otherwise, this function returns an error.
Note
To know more about PiP mode for video calls, please visit https://developer.apple.com/documentation/avkit/adopting_picture_in_picture_for_video_calls.

◆ subscribeWithView:aspectMode:andResolution:

- (ZoomVideoSDKError) subscribeWithView: (UIView *_Nullable) view
aspectMode: (ZoomVideoSDKVideoAspect) aspect
andResolution: (ZoomVideoSDKVideoResolution) resolution 

Subscribes to the user's video or share view.

Parameters
viewThe UIView object that you need to render data.
aspectThe render's aspect mode.
resolutionThe render's resolution. Valid only for video canvas.
Returns
If the function succeeds, it returns Errors_Success. Otherwise, this function returns an error.

◆ takeSnapshot:

- (UIImage *_Nullable) takeSnapshot: (UIView *_Nullable) view

Captures a snapshot of the current video frame from the specified UIView and returns it as a UIImage. This method captures the current frame being displayed in the video or share canvas.

Parameters
viewThe UIView currently subscribed to this canvas.
Returns
A UIImage containing the captured frame, or nil if the snapshot could not be taken. The returned image will be autoreleased.
Note
The view must be currently subscribed to this canvas; otherwise the method returns nil.
After taking a snapshot, a notification is sent to other users in the session via the onCanvasSnapshotTaken callback.

◆ unSubscribeWithView:

- (ZoomVideoSDKError) unSubscribeWithView: (UIView *_Nullable) view

Unsubscribes from video or share data.

Parameters
viewThe UIView object to unsubscribe.
Returns
If the function succeeds, it returns Errors_Success. Otherwise, this function returns an error.

◆ videoStatus

- (ZoomVideoSDKVideoStatus *_Nullable) videoStatus

Gets the user's video status.

Returns
If the function succeeds, it returns a ZoomVideoSDKVideoStatus object. Otherwise, this function fails and returns nil.
Warning
This interface is marked as deprecated, then it will be replaced by videoStatus (ZoomVideoSDKRawDataPipe) and videoStatus.