跳转至
400-881-9892

文档中心

官方文档,可查阅产品介绍、快速入门、用户指南、开发指南、API参考、SDK参考、帮助等信息。

文档中心 互动课堂

Turn on the large and small streams

enableDualStream
  • Brief description

Turn on the large and small streams

SDK supports sending multiple video streams simultaneously. Big and Small Streams: Since iOS mobile devices can only capture video from one camera, the local device will capture high-resolution video (the local video capture resolution must be no lower than 720p). This video will then be split into two streams: one high-quality stream, known as the “big stream,” and one low-quality stream, known as the “small stream.” Both streams will be published simultaneously. Due to the significant performance consumption, this feature should be enabled with caution.

  • Interface name

- (int)enableDualStream:(BOOL)enable;

  • Parameter
Parameter Name Required Type Description
enable Yes BOOL Enable/Disable
  • Method Example

[_roomMgr enableDualStream:YES];

  • Return Value Description
Type Description
int 0: Indicates that the call was successful. Non-zero: Indicates that the call failed

setSmallStreamParameter

  • Brief description

Set the video resolution for the small stream

  • Interface name

- (int)setSmallStreamParameter:(TKVideoProfile *)profile;

  • Parameter
Parameter Name Required Type Description
profile Yes TKVideoProfile The video resolution object, see the definition in TKRoomDefines.h
  • Method Example
1
2
3
4
5
    TKVideoProfile *videoProfile = [TKVideoProfile new];
    videoProfile.width = 80;
    videoProfile.height = 60;
    videoProfile.maxfps = 10;
    [_roomMgr setSmallStreamParameter:videoProfile];
  • Return Value Description
Type Description
int 0: Indicates that the call was successful. Non-zero: Indicates that the call failed

setRemoteDefaultVideoStreamType

  • Brief description

Set the default type of the remote video stream. If not set, it defaults to TKVideoStream_Big. This only takes effect if the remote user has enabled the dual-stream mode (big and small streams)

  • Interface name

- (int)setRemoteDefaultVideoStreamType:(TKVideoStreamType)streamType;

  • Parameter
Parameter Name Required Type Description
streamType Yes TKVideoStreamType Big and Small Stream Types
  • Method Example

[_roomMgr setRemoteDefaultVideoStreamType:TKVideoStream_Big];

  • Return Value Description
Type Description
int 0: Indicates that the call was successful. Non-zero: Indicates that the call failed

setRemoteVideoStreamType

  • Brief description

Switch the subscription to the big or small stream type of a specific video device of a remote user. This only takes effect if the remote user has enabled the dual-stream mode

  • Interface name

- (int)setRemoteVideoStreamType:(TKVideoStreamType)streamType peerId:(NSString *)peerID deviceId:(NSString * _Nullable)deviceID;

  • Parameter
Parameter Name Required Type Description
streamType Yes TKVideoStreamType Stream Type
peerID Yes NSString User ID
deviceID No NSString Camera Device ID
  • Method Example
1
2
3
      [_roomMgr setRemoteVideoStreamType:TKVideoStream_Big
                                peerId:@"adc123456"
                              deviceId:nil];
  • Return Value Description
Type Description
int 0: Indicates that the call was successful. Non-zero: Indicates that the call failed

Notes

For more return error codes, please refer to the error code descriptions in TKRoomErrorCode