tencent cloud

Feedback

Overview

Last updated: 2022-12-23 17:44:57

    V2TXLivePlayer

    Video player

    For details, see V2TXLivePlayer.
    The player pulls audio/video data from the specified live streaming URL and plays the data after decoding and local rendering.
    The player has the following capabilities:

    • Playing over protocols including RTMP, HTTP-FLV, TRTC, and WebRTC
    • Taking screenshots of streamed video
    • Delay adjustment. You can set the minimum and maximum cache time for auto adjustment by the player.
    • Custom video processing. You can process live video based on your project requirements before rendering and playback.

    Basic SDK APIs

    API Description
    setObserver Sets player callbacks.

    Basic playback APIs

    API Description
    setRenderView Sets the player’s rendering view.
    startLivePlay Since v10.7, startPlay has been replaced by startLivePlay, and you need to call V2TXLivePremier#setLicence or TXLiveBase#setLicence to set the license to use the live playback feature (you only need to set the license once). Otherwise, playback will fail (black screen). You can use a live stream publishing license, UGSV license, or video playback license to activate the live playback feature. If you don’t have any of the licenses, you can buy one or apply for a trial license for free to use the feature.
    stopPlay Stops playback.
    isPlaying Gets whether playback is ongoing.

    Video APIs

    API Description
    setRenderRotation Sets video rotation.
    setRenderFillMode Sets the fill mode.
    pauseVideo Pauses the player’s video.
    resumeVideo Resumes the player’s video.
    snapshot Takes a screenshot of the played video.
    enableCustomRendering Sets the callback for custom video rendering.

    Audio APIs

    API Description
    pauseAudio Pauses the player’s audio.
    resumeAudio Resumes the player’s audio.
    setPlayoutVolume Sets the volume.
    enableVolumeEvaluation Enables the volume reminder for playback.

    Other APIs

    API Description
    setCacheParams Sets the minimum and maximum cache time (seconds) for auto adjustment by the player.
    showDebugView Sets whether to show the debug view of player status information.

    V2TXLivePlayerObserver

    Player callbacks

    Basic SDK callback APIs

    API Description
    onError Callback for error. This callback is returned when the player encounters an error.
    onWarning Callback for warning
    onConnected Callback for successfully connecting to the server

    Video callback APIs

    API Description
    onVideoPlaying Callback for video playback
    onVideoLoading Callback for loading video
    onVideoResolutionChanged Callback for change of player resolution
    onSnapshotComplete Callback for a screenshot taken
    onRenderVideoFrame Callback for custom video rendering

    Audio callback APIs

    API Description
    onAudioPlaying Callback for audio playback
    onAudioLoading Callback for loading audio
    onPlayoutVolumeUpdate Callback of the player’s volume

    Statistics callback APIs

    API Description
    onStatisticsUpdate Callback of player statistics

    V2TXLivePusher

    Stream publisher

    For details, see V2TXLivePusher.

    V2TXLivePusher encodes local audio/video and publishes the encoded data to a specified URL. It supports any publishing server.
    It has the following capabilities:

    • Custom video capturing. You can customize audio/video data sources based on your project requirements.
    • Retouching, filters, and stickers. V2TXLivePusher integrates multiple retouching algorithms (natural & smooth) and color space filters (custom filters are supported).
    • QoS control technology. V2TXLivePusher can adapt automatically to different upstream network conditions by controlling audio/video traffic in real time based on the network conditions of hosts.
    • Facial feature adjustment and animated widgets. Powered by YouTu’s AI facial recognition technology, V2TXLivePusher supports animated widgets and fine-tuning of facial features, such as eye enlarging, face slimming, and nose reshaping. You need to purchase a YouTu license to use these live streaming effects.

    Basic SDK APIs

    API Description
    setObserver Sets publisher callbacks.

    Basic publishing APIs

    API Description
    setRenderView Sets the rendering view for local camera preview.
    startPush Starts publishing audio/video data.
    stopPush Stops publishing audio/video data.
    isPushing Gets whether publishing is ongoing.

    Video APIs

    API Description
    setVideoQuality Sets video encoding parameters for publishing.
    setRenderRotation Sets video rotation for local camera preview.
    setRenderMirror Sets the mirror mode for local camera preview.
    startCamera Turns the local camera on.
    stopCamera Turns the local camera off.
    startVirtualCamera Starts image publishing.
    stopVirtualCamera Stops image publishing.
    startScreenCapture Starts screen capturing.
    stopScreenCapture Stops screen capturing.
    snapshot Takes a screenshot of the published video.
    setWatermark Sets watermarks for the publisher. Watermarking is disabled by default.
    setEncoderMirror Sets the mirror mode for encoded video.
    enableCustomVideoCapture Enables/Disables custom video capturing.
    sendCustomVideoFrame Sends the captured video data to the SDK in the custom video capturing mode.
    enableCustomVideoProcess Enables/Disables custom video processing.
    sendSeiMessage Sends an SEI message.

    Beauty filter APIs

    API Description
    getBeautyManager Gets the beauty filter management object TXBeautyManager, which is used to set beauty filters.

    Audio APIs

    API Description
    startMicrophone Turns the mic on.
    stopMicrophone Turns the mic off.
    setAudioQuality Sets the quality of published audio.
    enableVolumeEvaluation Enables the volume reminder for capturing.

    Audio effect APIs

    API Description
    getAudioEffectManager Gets the audio effect management object.

    Device management APIs

    API Description
    getDeviceManager Gets the device management object.

    Other APIs

    API Description
    setProperty Calls an advanced API of V2TXLivePusher.
    setMixTranscodingConfig Sets On-Cloud MixTranscoding parameters.
    showDebugView Sets whether to display the dashboard.

    V2TXLivePusherObserver

    Basic SDK callback APIs

    API Description
    onError Callback for error. This callback is returned when the publisher encounters an error.
    onWarning Callback for warning

    Video callback APIs

    API Description
    onPushStatusUpdate Callback of the publisher’s connection status
    onSnapshotComplete Callback for a screenshot taken
    onProcessVideoFrame Callback for custom video processing
    onGLContextDestroyed Callback for destroying the OpenGL context in the SDK
    onCaptureFirstVideoFrame Callback for capturing the first video frame

    Audio callback APIs

    API Description
    onCaptureFirstAudioFrame Callback for capturing the first audio frame
    onMicrophoneVolumeUpdate Callback of mic capturing volume

    Mixtranscoding callback APIs

    API Description
    onSetMixTranscodingConfig Callback for setting On-Cloud MixTranscoding parameters

    Statistics callback APIs

    API Description
    onStatisticsUpdate Callback of publisher statistics