400-881-9892

文档中心

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

文档中心 互动课堂

Turn On The Large And Small Streams

    enableDualStream
    • A brief description - Turn on the large and small streams

    SDK support, multiple video streams sent simultaneously. - Large and small streams: Since Android mobile devices can only open one camera to capture video, the local device will capture high-resolution video (the local video capture resolution must be no less than 720p). Then, it will be split into two video streams. One is of high quality, called the large stream, and the other is of low quality, called the small stream. Both video streams will be published simultaneously. Due to the significant performance consumption, use this feature with caution.

    • Interface Name

    - (int)enableDualStream(boolean enable);

    • Parameters
    Parameter Name Required Type Description
    enable Yes boolean Turn on/Turn off
    • Method Example

    TKRoomManager.getInstance().enableDualStream(true);

    • Return Value Description
    Type Description
    int 0: Indicates successful invocation; Non-zero: Indicates invocation failure
    setSmallStreamParameter
    • A brief description - Set the video resolution of the small stream

    • Interface Name

    - (int)setSmallStreamParameter(VideoProfile profile);

    • Parameters
    Parameter Name Required Type Description
    profile Yes VideoProfile Video resolution object
    • Method Example
    1
    2
    3
    4
    5
        VideoProfile videoProfile = new VideoProfile;
        videoProfile.width = 80;
        videoProfile.height = 60;
        videoProfile.maxfps = 10;
        TKRoomManager.getInstance().setSmallStreamParameter(profile);
    
    • Return Value Description
    Type Description
    int 0: Indicates successful invocation; Non-zero: Indicates invocation failure
    setRemoteDefaultVideoStreamType
    • A brief description - Set the default type of the remote video stream. If not set, the default is TK_VIDEO_STREAM_BIG. This only takes effect when the remote user has enabled the large and small stream mode

    • Interface Name

    - (int)setRemoteDefaultVideoStreamType(TK_VIDEO_STREAM_TYPE streamType);

    • Parameters
    Parameter Name Required Type Description
    streamType Yes TK_VIDEO_STREAM_TYPE Large and Small Flow Types
    • Method Example

    TKRoomManagerImpl.getInstance().setRemoteDefaultVideoStreamType(TK_VIDEO_STREAM_TYPE.TK_VIDEO_STREAM_BIG);

    • Return Value Description
    Type Description
    int 0: Indicates successful invocation; Non-zero: Indicates invocation failure
    setRemoteVideoStreamType
    • A brief description - Switch the subscription type of the large or small stream of a video device from a remote user. This only takes effect when the remote user has enabled the large and small stream mode

    • Interface Name

    - (int)setRemoteVideoStreamType(TK_VIDEO_STREAM_TYPE streamType, String peerId, String deviceId);

    • Parameters
    Parameter Name Required Type Description
    streamType Yes TK_VIDEO_STREAM_TYPE Large and Small Flow Types
    peerID Yes String User ID
    deviceID No String camera equipment ID
    • Method Example

    TKRoomManagerImpl.getInstance().setRemoteVideoStreamType(TK_VIDEO_STREAM_TYPE.TK_VIDEO_STREAM_BIG, "123", deviceId);

    • Return Value Description
    Type Description
    int 0: Indicates successful invocation; Non-zero: Indicates invocation failure