tencent cloud


API Documentation

Last updated: 2022-07-13 17:59:30


    Video player

    For more information, see TXLivePlayer.

    TXLivePlayer decodes the audio and video data in live streams and performs local rendering. It provides the following capabilities:

    • For Tencent Cloud's playback addresses, use low-delay playback to implement live streaming mic connect.
    • For Tencent Cloud's playback addresses, use live streaming time shifting to implement seamless switching between live viewing and time-shifting viewing.
    • Custom audio and video data processing allows you to process the audio and video data in live streams based on project requirements and then render and playback them.

    Basic SDK APIs

    API Description
    delegate Sets the playback callback. For more information, see the detailed definition in the TXLivePlayListener.h file.
    videoProcessDelegate Sets the video processing callback. For more information, see the detailed definition in the TXVideoCustomProcessDelegate.h file.
    audioRawDataDelegate Sets the audio processing callback. For more information, see the detailed definition in the TXAudioRawDataDelegate.h file.
    enableHWAcceleration Sets whether to enable hardware acceleration. Default value: NO.
    config Sets TXLivePlayConfig playback configuration items. For more information, see the detailed definition in the TXLivePlayConfig.h file.
    recordDelegate Sets the short video recording callback. For more information, see the detailed definition in the TXLiveRecordListener.h file.
    isAutoPlay Sets whether to start playback immediately after call of startPlay. This API takes effect only for VOD. Default value: YES.

    Basic playback APIs

    API Description
    setupVideoWidget Creates the video rendering view. This control is used to display the video content.
    removeVideoWidget Removes the video rendering widget.
    startPlay Plays back the RTMP audio/video stream at the specified URL.
    stopPlay Stops the audio/video stream.
    isPlaying Gets whether playback is ongoing.
    pause Pauses playback.
    resume Resumes playback. This API can be used for VOD and live streaming.

    Video APIs

    API Description
    setRenderRotation Sets the orientation of the video image.
    setRenderMode Sets the image cropping mode.
    snapshot Takes a screenshot.

    Audio APIs

    API Description
    setMute Mutes/Unmutes the player.
    setVolume Sets the volume level.
    setAudioRoute Sets the audio playback mode (speaker or receiver).
    setAudioVolumeEvaluationListener Sets the volume level callback.

    Live streaming time shifting APIs

    API Description
    prepareLiveSeek Prepares for live streaming time shifting and pulls the playback start time of the live stream.
    resumeLive Resumes live playback from time-shifting playback.
    seek -

    Video recording APIs

    API Description
    startRecord Starts short video recording.
    stopRecord Stops short video recording.
    setRate Sets the playback speed.

    Other APIs

    API Description
    setLogViewMargin Sets the margin between the rendering view and the status floating view.
    showVideoDebugLog Sets whether to display the playback status statistics and event message floating view.
    switchStream Switches FLV live streams smoothly.
    callExperimentalAPI Calls an experimental API.

    Enumerated values

    Enumerated Value Description
    TX_Enum_PlayType Supported live streaming and VOD types.


    TXLivePlayer parameter configuration module

    For more information, see TXLivePlayConfig.

    It is used to set TXLivePlayer parameters, most of which cannot take effect if they are set after playback starts.


    TXLivePlayer callback notifications

    For more information, see TXLivePlayListener.

    API Description
    onPlayEvent Live streaming event notification.
    onNetStatus Network status notification.
    Contact Us

    Contact our sales team or business advisors to help your business.

    Technical Support

    Open a ticket if you're looking for further assistance. Our Ticket is 7x24 avaliable.

    7x24 Phone Support