Overview

Last updated: 2021-08-12 18:01:29

V2TXLivePlayer

Video player

For details, please 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.
startPlay Starts playback.
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 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 (s) 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

Video callback APIs

API Description
onVideoPlayStatusUpdate Callback for the change of video status
onSnapshotComplete Callback for a screenshot taken
onRenderVideoFrame Callback for custom video rendering

Audio callback APIs

API Description
onAudioPlayStatusUpdate Callback for the change of audio status
onPlayoutVolumeUpdate Callback for the player’s volume

Statistics callback APIs

API Description
onStatisticsUpdate Callback for player statistics

V2TXLivePusher

Stream publisher

For details, please 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.
startScreenCapture Starts screen capturing.
stopScreenCapture Stops screen capturing.

Video APIs

API Description
setVideoQuality Sets the resolution and aspect ratio mode (portrait/landscape) of published video.
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.
snapshot Takes a screenshot of published video.
setWatermark Sets watermarks for the publisher. Watermarking is disabled by default.
setEncoderMirror Sets the mirror mode for encoded video.

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 Displays 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 for 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 for mic capturing volume

Mixtranscoding callback APIs

API Description
onSetMixTranscodingConfig Callback for setting On-Cloud MixTranscoding parameters

Statistics callback APIs

API Description
onStatisticsUpdate Callback for publisher statistics