tencent cloud


API Documentation

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


    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
    TXLivePlayer Creates a TXLivePlayer instance.
    setConfig Sets TXLivePlayer playback configuration items.
    setPlayListener Sets the stream push callback.

    Basic playback APIs

    API Description
    setPlayerView Sets the player's rendering view.
    startPlay Starts playback.
    stopPlay Stops playback.
    isPlaying Gets whether playback is ongoing.
    pause Pauses playback.
    resume Resumes playback.
    setSurface Uses the surface mode for local rendering.
    setSurfaceSize Sets the rendering surface size.

    Playback configuration APIs

    API Description
    setRenderMode Sets the playback rendering mode.
    setRenderRotation Sets the image rendering angle.
    enableHardwareDecode Enables hardware acceleration.
    setMute Sets whether to mute the player.
    setAudioRoute Sets the audio playback mode.
    setVolume Sets the volume level.
    switchStream Switches between definitions.
    setAudioVolumeEvaluationListener Sets the volume level callback.

    Local recording and screenshot APIs

    API Description
    setVideoRecordListener Sets the recording callback.
    startRecord Starts video recording.
    stopRecord Stops video recording.
    snapshot Takes a screenshot locally during playback.

    Custom data processing APIs

    API Description
    addVideoRawData Sets the software decoding data carrier buffer.
    setVideoRawDataListener Sets the software decoding video data callback.
    setAudioRawDataListener Sets the audio data callback.

    Live streaming time shifting APIs

    API Description
    prepareLiveSeek Prepares for live streaming time shifting.
    seek Seeks to the live stream playback time.
    resumeLive Resumes live streaming.

    Screenshot callback APIs

    For more information, see ITXSnapshotListener.

    API Description
    onSnapshot A screenshot taken.

    Video data callback APIs for software decoding

    For more information, see ITXVideoRawDataListener.

    API Description
    onVideoRawDataAvailable A frame decoded by the software decoder.

    Raw audio data callback APIs

    For more information, see ITXAudioRawDataListener.

    API Description
    onPcmDataAvailable Audio playback data in PCM format.
    onAudioInfoChanged Audio playback information.

    Player volume callback APIs

    For more information, see ITXAudioVolumeEvaluationListener.

    API Description
    onAudioVolumeEvaluationNotify The player's volume level. Value range: 0–100.


    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.

    Common APIs

    API Description
    setAutoAdjustCacheTime Sets whether to automatically adjust the cache time.
    setCacheTime Sets the player cache time.
    setMaxAutoAdjustCacheTime Sets the maximum cache time.
    setMinAutoAdjustCacheTime Sets the minimum cache time.
    setVideoBlockThreshold Sets the video lagging alarm threshold for the player.
    setConnectRetryCount Sets the maximum number of player reconnection attempts.
    setConnectRetryInterval Sets the player reconnection interval.

    Dedicated APIs

    API Description
    setEnableMessage Enables the message channel.
    enableAEC Sets acoustic echo cancellation (AEC).


    TXLivePlayer callback notifications

    For more information, see ITXLivePlayListener.

    API Description
    onPlayEvent Playback 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