You need to enable JavaScript to run this app.
文档中心
视频直播

视频直播

复制全文
下载 pdf
SDK API 参考
类型详情
复制全文
下载 pdf
类型详情

VeLivePlayerResolution
public static class com.ss.videoarch.liveplayer.VeLivePlayerDef.VeLivePlayerResolution

直播播放器的清晰度档位。

成员变量

类型

默认值

名称

String

"origin"

VeLivePlayerResolutionOrigin

String

"uhd"

VeLivePlayerResolutionUHD

String

"hd"

VeLivePlayerResolutionHD

String

"sd"

VeLivePlayerResolutionSD

String

"ld"

VeLivePlayerResolutionLD

String

VeLivePlayerResolutionOrigin

resolutionStr

成员函数

返回

名称

VeLivePlayerResolution

VeLivePlayerResolution

变量说明

VeLivePlayerResolutionOrigin

public static final String com.ss.videoarch.liveplayer.VeLivePlayerDef.VeLivePlayerResolution.VeLivePlayerResolutionOrigin = "origin"

原始流。

VeLivePlayerResolutionUHD

public static final String com.ss.videoarch.liveplayer.VeLivePlayerDef.VeLivePlayerResolution.VeLivePlayerResolutionUHD = "uhd"

UHD 超高清。

VeLivePlayerResolutionHD

public static final String com.ss.videoarch.liveplayer.VeLivePlayerDef.VeLivePlayerResolution.VeLivePlayerResolutionHD = "hd"

HD 高清。

VeLivePlayerResolutionSD

public static final String com.ss.videoarch.liveplayer.VeLivePlayerDef.VeLivePlayerResolution.VeLivePlayerResolutionSD = "sd"

SD 标清。

VeLivePlayerResolutionLD

public static final String com.ss.videoarch.liveplayer.VeLivePlayerDef.VeLivePlayerResolution.VeLivePlayerResolutionLD = "ld"

LD 低清。

resolutionStr

public String com.ss.videoarch.liveplayer.VeLivePlayerDef.VeLivePlayerResolution.resolutionStr = VeLivePlayerResolutionOrigin

创建对象时传入的初始分辨率档位。

函数说明

VeLivePlayerResolution

public com.ss.videoarch.liveplayer.VeLivePlayerDef.VeLivePlayerResolution.VeLivePlayerResolution(String res)

构造方法。
传入参数

参数名

类型

说明

res

String

分辨率档位。

VeLivePlayerConfiguration
public final class com.ss.videoarch.liveplayer.VeLivePlayerConfiguration

播放器初始化相关配置。

成员变量

类型

默认值

名称

boolean

false

enableSei

boolean

false

enableBinarySei

boolean

true

enableHardwareDecode

int

5_000

networkTimeoutMs

int

5_000

retryIntervalTimeMs

int

5

retryMaxCount

boolean

false

enableLiveDNS

boolean

false

enableStatisticsCallback

int

5

statisticsCallbackInterval

long

10_000

stallRetryTimeout

变量说明

enableSei

public boolean com.ss.videoarch.liveplayer.VeLivePlayerConfiguration.enableSei = false

是否开启字符串 SEI 消息的解析,默认值为 false。

  • true:开启;
  • false:关闭。

enableBinarySei

public boolean com.ss.videoarch.liveplayer.VeLivePlayerConfiguration.enableBinarySei = false

是否开启二进制 SEI 消息的解析,默认值为 false。

  • true:开启;
  • false:关闭。

注意
二进制 SEI 开启后,字符串 SEI 的回调将不再发送。

enableHardwareDecode

public boolean com.ss.videoarch.liveplayer.VeLivePlayerConfiguration.enableHardwareDecode = true

是否开启硬件解码功能,默认值为 true。开启硬件解码后,如果出现硬件解码启动失败或硬件解码失败的情况,播放器内部会自动切换为软解。

  • true:开启;
  • false:关闭。

networkTimeoutMs

public int com.ss.videoarch.liveplayer.VeLivePlayerConfiguration.networkTimeoutMs = 5_000

网络超时时间,单位为 ms,默认值为 5000。播放器发起网络请求,如果超过了该时间仍未收到服务器响应,则认为网络请求失败。

retryIntervalTimeMs

public int com.ss.videoarch.liveplayer.VeLivePlayerConfiguration.retryIntervalTimeMs = 5_000

重试时间间隔。单位为 ms,默认值为 5000。如果需要为每个流单独设置重试间隔,可以设置 retryIntervalTimeMs。

retryMaxCount

public int com.ss.videoarch.liveplayer.VeLivePlayerConfiguration.retryMaxCount = 5

在网络连接错误的情况下,播放器的最大重试次数。默认值为 5。如果取值为 0,表示关闭播放器内部重试。如果需要为每个流单独设置最大重试次数,可以设置 retryMaxCount。

enableLiveDNS

public boolean com.ss.videoarch.liveplayer.VeLivePlayerConfiguration.enableLiveDNS = false

是否开启本地 DNS 预解析,默认值为 false。开启本地 DNS 预解析可以缩短启播时间。如果本地 DNS 预解析出现异常,可能会影响播放器的正常使用。

  • true:开启;
  • false:关闭。

enableStatisticsCallback

public boolean com.ss.videoarch.liveplayer.VeLivePlayerConfiguration.enableStatisticsCallback = false

是否开启播放信息周期性回调。默认值为 false。周期性回调参数详细说明请参见 VeLivePlayerStatistics 。当 enableStatisticsCallback 为 true,且 statisticsCallbackInterval 大于 0 时,播放器会在指定的时间间隔内,周期性地回调播放器状态信息。

  • true:开启;
  • false:关闭。

statisticsCallbackInterval

public int com.ss.videoarch.liveplayer.VeLivePlayerConfiguration.statisticsCallbackInterval = 5

播放信息周期性回调的时间间隔,单位为 s,默认值为 5。当 enableStatisticsCallback 为 true,且 statisticsCallbackInterval 大于 0 时,播放器会在指定的时间间隔内,周期性地回调播放器状态信息。

stallRetryTimeout

public long com.ss.videoarch.liveplayer.VeLivePlayerConfiguration.stallRetryTimeout = 10_000

卡顿超时停止重试阈值。当卡顿时长超过该阈值时,播放器将不再进行重试。单位为 ms。默认值为 10000,即 10 秒。

VeLivePlayerFormat
public enum com.ss.videoarch.liveplayer.VeLivePlayerDef.VeLivePlayerFormat

直播播放格式。

枚举值

类型

值

说明

VeLivePlayerFormatFLV

0

FLV 格式。

VeLivePlayerFormatHLS

1

HLS 格式。

VeLivePlayerFormatRTM

2

RTM 格式。

VeLivePlayerFormatCMAF

3

CMAF 格式

VeLivePlayerProtocol
public enum com.ss.videoarch.liveplayer.VeLivePlayerDef.VeLivePlayerProtocol

直播播放传输协议。

枚举值

类型

值

说明

VeLivePlayerProtocolTCP

0

TCP 协议。

VeLivePlayerProtocolQUIC

1

QUIC 协议。

VeLivePlayerProtocolTLS

2

TLS 协议。

VeLivePlayerProtocolHTTP2

3

HTTP/2 协议。

VeLivePlayerProtocolDefault

4

默认值。播放器将根据拉流地址自动识别网络协议。目前仅支持自动识别 TCP 和 TLS 协议。如需使用 QUIC 或 HTTP/2 协议,请使用对应取值。

VeLivePlayerMirror
public enum com.ss.videoarch.liveplayer.VeLivePlayerDef.VeLivePlayerMirror

视频镜像。

枚举值

类型

值

说明

VeLivePlayerMirrorNone

0

关闭镜像。

VeLivePlayerMirrorHorizontal

1

水平镜像。

VeLivePlayerMirrorVertical

2

垂直镜像。

VeLivePlayerVideoBufferType
public enum com.ss.videoarch.liveplayer.VeLivePlayerDef.VeLivePlayerVideoBufferType

视频数据封装格式。

枚举值

类型

值

说明

VeLivePlayerVideoBufferTypeUnknown

0

未知格式。

VeLivePlayerVideoBufferTypeByteBuffer

1

ByteBuffer 格式。

VeLivePlayerVideoBufferTypeByteArray

2

ByteArray 格式。

VeLivePlayerVideoBufferTypeTexture

3

纹理格式。

VeLivePlayerStatus
public enum com.ss.videoarch.liveplayer.VeLivePlayerDef.VeLivePlayerStatus

直播播放器状态。

枚举值

类型

值

说明

VeLivePlayerStatusStopped

0

停止播放状态。

VeLivePlayerStatusPaused

1

暂停播放状态。

VeLivePlayerStatusPrepared

2

播放器准备完成,等待渲染。

VeLivePlayerStatusPlaying

3

正在播放,即首帧渲染完成且播放器未发生错误。

VeLivePlayerStatusError

4

播放器发生错误。

VeLivePlayerStatusStalled

5

播放器发生卡顿。

VeLivePlayerLogConfig
public class com.ss.videoarch.liveplayer.log.VeLivePlayerLogConfig

日志配置。

成员变量

类型

默认值

名称

VeLivePlayerLogLevel

VeLivePlayerLogLevel.VeLivePlayerLogLevelVerbose

logLevel

变量说明

logLevel

public VeLivePlayerLogLevel com.ss.videoarch.liveplayer.log.VeLivePlayerLogConfig.logLevel = VeLivePlayerLogLevel.VeLivePlayerLogLevelVerbose

允许写入的日志等级,默认为 VeLivePlayerLogLevelDebug,详情请参见 VeLivePlayerLogLevel。

VeLivePlayerStreamData
public class com.ss.videoarch.liveplayer.VeLivePlayerStreamData

播放地址相关配置。

成员变量

类型

默认值

名称

boolean

false

enableABR

boolean

false

enableMainBackupSwitch

VeLivePlayerResolution

new VeLivePlayerResolution(VeLivePlayerResolution.VeLivePlayerResolutionOrigin)

defaultResolution

VeLivePlayerFormat

VeLivePlayerFormat.VeLivePlayerFormatFLV

defaultFormat

VeLivePlayerProtocol

VeLivePlayerProtocol.VeLivePlayerProtocolTCP

defaultProtocol

List

null

mainStreamList

List

null

backupStreamList

boolean

false

enableSmoothSwitchResolution

变量说明

enableABR

public boolean com.ss.videoarch.liveplayer.VeLivePlayerStreamData.enableABR = false

是否打开 ABR 平滑切档功能,默认为 false。

  • true:开启;
  • false:关闭。

enableMainBackupSwitch

public boolean com.ss.videoarch.liveplayer.VeLivePlayerStreamData.enableMainBackupSwitch = false

是否打开主备切换,默认为 false。

  • true:开启;
  • false:关闭。

defaultResolution

public VeLivePlayerResolution com.ss.videoarch.liveplayer.VeLivePlayerStreamData.defaultResolution = new VeLivePlayerResolution(VeLivePlayerResolution.VeLivePlayerResolutionOrigin)

播放器的默认清晰度档位,默认使用原始流清晰度。详情请参见 VeLivePlayerResolution。

defaultFormat

public VeLivePlayerFormat com.ss.videoarch.liveplayer.VeLivePlayerStreamData.defaultFormat = VeLivePlayerFormat.VeLivePlayerFormatFLV

播放器的默认播放格式,默认值为 FLV。详情请参见 VeLivePlayerFormat。

defaultProtocol

public VeLivePlayerProtocol com.ss.videoarch.liveplayer.VeLivePlayerStreamData.defaultProtocol = VeLivePlayerProtocol.VeLivePlayerProtocolTCP

播放器的默认播放传输层协议,默认值为 TCP。详情请参见 VeLivePlayerProtocol。

mainStreamList

public List<VeLivePlayerStream> com.ss.videoarch.liveplayer.VeLivePlayerStreamData.mainStreamList = null

主路流地址列表,详情请参见 VeLivePlayerStream。

backupStreamList

public List<VeLivePlayerStream> com.ss.videoarch.liveplayer.VeLivePlayerStreamData.backupStreamList = null

备路流地址列表。详情请参见 VeLivePlayerStream。

enableSmoothSwitchResolution

public boolean com.ss.videoarch.liveplayer.VeLivePlayerStreamData.enableSmoothSwitchResolution = false

是否开启平滑切换清晰度功能。默认值为 false。开启后,在调用 switchResolution 手动切换清晰度时,SDK 会尝试进行平滑过渡,避免出现黑屏或卡顿。取值如下:

  • true:开启。
  • false:关闭。

VeLivePlayerResolutionSwitchReason
public enum com.ss.videoarch.liveplayer.VeLivePlayerDef.VeLivePlayerResolutionSwitchReason

直播播放器清晰度档位变化原因。

枚举值

类型

值

说明

VeLiveplayerResolutionSwitchByAuto

0

ABR 自动切档。

VeLiveplayerResolutionSwitchByManual

1

调用 switchResolution 手动切换档位导致的分辨率变化。

VeLivePlayerSupportResolutionSwitchError
public static class com.ss.videoarch.liveplayer.VeLivePlayerError.VeLivePlayerSupportResolutionSwitchError

清晰度档位切换错误。

成员变量

类型

默认值

名称

int

0

VeLivePlayerNoError

int

-1

VeLivePlayerErrorInvalidRes

int

-2

VeLivePlayerErrorSameRes

int

-3

VeLivePlayerErrorStatusInvalid

int

-4

VeLivePlayerErrorResNotFound

int

-5

VeLivePlayerErrorFormatNotSupport

int

-6

VeLivePlayerErrorConfigNotSupport

变量说明

VeLivePlayerNoError

public static final int com.ss.videoarch.liveplayer.VeLivePlayerError.VeLivePlayerSupportResolutionSwitchError.VeLivePlayerNoError = 0

没有错误。

VeLivePlayerErrorInvalidRes

public static final int com.ss.videoarch.liveplayer.VeLivePlayerError.VeLivePlayerSupportResolutionSwitchError.VeLivePlayerErrorInvalidRes = -1

清晰度档位无效。

VeLivePlayerErrorSameRes

public static final int com.ss.videoarch.liveplayer.VeLivePlayerError.VeLivePlayerSupportResolutionSwitchError.VeLivePlayerErrorSameRes = -2

和当前清晰度档位相同。

VeLivePlayerErrorStatusInvalid

public static final int com.ss.videoarch.liveplayer.VeLivePlayerError.VeLivePlayerSupportResolutionSwitchError.VeLivePlayerErrorStatusInvalid = -3

播放器状态为非 prepare 状态。

VeLivePlayerErrorResNotFound

public static final int com.ss.videoarch.liveplayer.VeLivePlayerError.VeLivePlayerSupportResolutionSwitchError.VeLivePlayerErrorResNotFound = -4

没有找到对应清晰度档位。

VeLivePlayerErrorFormatNotSupport

public static final int com.ss.videoarch.liveplayer.VeLivePlayerError.VeLivePlayerSupportResolutionSwitchError.VeLivePlayerErrorFormatNotSupport = -5

当前播放格式不支持该档位。

VeLivePlayerErrorConfigNotSupport

public static final int com.ss.videoarch.liveplayer.VeLivePlayerError.VeLivePlayerSupportResolutionSwitchError.VeLivePlayerErrorConfigNotSupport = -6

当前播放配置不支持该档位。

VeLivePlayerStream
public static class com.ss.videoarch.liveplayer.VeLivePlayerStreamData.VeLivePlayerStream

流地址信息。

成员变量

类型

默认值

名称

String

null

url

VeLivePlayerResolution

new VeLivePlayerResolution(VeLivePlayerResolution.VeLivePlayerResolutionOrigin)

resolution

long

-

bitrate

VeLivePlayerFormat

VeLivePlayerFormat.VeLivePlayerFormatFLV

format

VeLivePlayerStreamType

VeLivePlayerStreamType.VeLivePlayerStreamTypeMain

streamType

int

0

priority

int

-1

retryMaxCount

int

-1

retryIntervalTimeMs

VeLivePlayerProtocol

VeLivePlayerProtocol.VeLivePlayerProtocolDefault

protocol

变量说明

url

public String com.ss.videoarch.liveplayer.VeLivePlayerStreamData.VeLivePlayerStream.url = null

播放地址。

resolution

public VeLivePlayerResolution com.ss.videoarch.liveplayer.VeLivePlayerStreamData.VeLivePlayerStream.resolution = new VeLivePlayerResolution(VeLivePlayerResolution.VeLivePlayerResolutionOrigin)

清晰度档位。详情请参见 VeLivePlayerResolution。

bitrate

public long com.ss.videoarch.liveplayer.VeLivePlayerStreamData.VeLivePlayerStream.bitrate

播放码率,单位为 kbps。

format

public VeLivePlayerFormat com.ss.videoarch.liveplayer.VeLivePlayerStreamData.VeLivePlayerStream.format = VeLivePlayerFormat.VeLivePlayerFormatFLV

播放格式。详情请参见 VeLivePlayerFormat。

streamType

public VeLivePlayerStreamType com.ss.videoarch.liveplayer.VeLivePlayerStreamData.VeLivePlayerStream.streamType = VeLivePlayerStreamType.VeLivePlayerStreamTypeMain

播放流类型为主路或备路。详情请参见 VeLivePlayerStreamType。

priority

public int com.ss.videoarch.liveplayer.VeLivePlayerStreamData.VeLivePlayerStream.priority = 0

流的优先级。取值必须为 0(默认值)或正整数。取值越大,优先级越高。

retryMaxCount

public int com.ss.videoarch.liveplayer.VeLivePlayerStreamData.VeLivePlayerStream.retryMaxCount = -1

流的最大重试次数,即总播放尝试次数(包含首次尝试)。例如,若取值为 3,则在首次播放失败后,播放器最多会再重试 2 次。取值如下:

  • -1(默认值):使用 VeLivePlayerConfiguration 中 retryMaxCount 的取值。
  • 0:不会尝试播放当前流。
  • > 0:具体次数。

retryIntervalTimeMs

public int com.ss.videoarch.liveplayer.VeLivePlayerStreamData.VeLivePlayerStream.retryIntervalTimeMs = -1

重试时间间隔。单位为 ms,默认值为 -1。若取值为 -1,则使用 VeLivePlayerConfiguration 中 retryIntervalTimeMs 的取值。

protocol

public VeLivePlayerProtocol com.ss.videoarch.liveplayer.VeLivePlayerStreamData.VeLivePlayerStream.protocol = VeLivePlayerProtocol.VeLivePlayerProtocolDefault

传输协议,详情请参见 VeLivePlayerProtocol。

VeLivePlayerFillMode
public enum com.ss.videoarch.liveplayer.VeLivePlayerDef.VeLivePlayerFillMode

直播播放器画面的填充模式。

枚举值

类型

值

说明

VeLivePlayerFillModeAspectFit

0

显示完整的视频帧。视频帧等比缩放,直至视频帧恰好在画布上全部显示。如果视频帧长宽比例与画布不同,视窗上未被视频帧填满区域将填充为黑色。

VeLivePlayerFillModeFullFill

1

视频帧自适应画布。视频帧非等比缩放,直至填满画布。在此过程中,视频帧的长宽比例可能会发生变化。

VeLivePlayerFillModeAspectFill

2

视频填满画布。视频帧等比缩放,直至填满画布,超出屏幕的部分将被裁剪,画面可能不完整。

VeLivePlayerPixelFormat
public enum com.ss.videoarch.liveplayer.VeLivePlayerDef.VeLivePlayerPixelFormat

视频帧像素格式。

枚举值

类型

值

说明

VeLivePlayerPixelFormatUnknown

0

未知格式。

VeLivePlayerPixelFormatRGBA32

1

RGBA8888 格式。

VeLivePlayerPixelFormatTexture

2

纹理格式。

VeLivePlayerPixelFormatI420

3

YUV420P 格式。

VeLivePlayerStatistics
public class com.ss.videoarch.liveplayer.VeLivePlayerStatistics

播放周期性统计信息。

成员变量

类型

默认值

名称

String

-

url

boolean

-

isHardwareDecode

String

-

videoCodec

long

-

stallTimeMs

long

-

bandwidthEstimation

long

-

delayMs

int

-

width

int

-

height

float

-

fps

long

-

bitrate

long

-

videoBufferMs

long

-

audioBufferMs

VeLivePlayerFormat

-

format

VeLivePlayerProtocol

-

protocol

变量说明

url

public String com.ss.videoarch.liveplayer.VeLivePlayerStatistics.url

当前直播的播放地址。

isHardwareDecode

public boolean com.ss.videoarch.liveplayer.VeLivePlayerStatistics.isHardwareDecode

是否使用硬件解码。

  • true:硬解;
  • false:非硬解。

videoCodec

public String com.ss.videoarch.liveplayer.VeLivePlayerStatistics.videoCodec

视频的编码类型。

stallTimeMs

public long com.ss.videoarch.liveplayer.VeLivePlayerStatistics.stallTimeMs

从当前视频开始播放起,累计的卡顿时长,单位为 ms。

bandwidthEstimation

public long com.ss.videoarch.liveplayer.VeLivePlayerStatistics.bandwidthEstimation

带宽预测 ,单位为 kbps

delayMs

public long com.ss.videoarch.liveplayer.VeLivePlayerStatistics.delayMs

当前播放延时,单位为 ms。

width

public int com.ss.videoarch.liveplayer.VeLivePlayerStatistics.width

当前播放视频的宽度,单位为 px。

height

public int com.ss.videoarch.liveplayer.VeLivePlayerStatistics.height

当前播放视频的高度,单位为 px。

fps

public float com.ss.videoarch.liveplayer.VeLivePlayerStatistics.fps

当前播放视频的帧率,单位为 fps。

bitrate

public long com.ss.videoarch.liveplayer.VeLivePlayerStatistics.bitrate

实时下载的码率,单位为 kbps。

videoBufferMs

public long com.ss.videoarch.liveplayer.VeLivePlayerStatistics.videoBufferMs

视频播放的缓冲区 buffer 大小,单位为 ms。

audioBufferMs

public long com.ss.videoarch.liveplayer.VeLivePlayerStatistics.audioBufferMs

音频播放的缓冲区 buffer 大小,单位为 ms。

format

public VeLivePlayerFormat com.ss.videoarch.liveplayer.VeLivePlayerStatistics.format

当前播放的视频格式。详见 VeLivePlayerFormat。

protocol

public VeLivePlayerProtocol com.ss.videoarch.liveplayer.VeLivePlayerStatistics.protocol

当前播放的传输协议。详见 VeLivePlayerProtocol。

VeLivePlayerVideoFrame
public class com.ss.videoarch.liveplayer.VeLivePlayerVideoFrame

视频帧数据。

成员变量

类型

默认值

名称

VeLivePlayerVideoBufferType

-

bufferType

VeLivePlayerPixelFormat

-

pixelFormat

int

-

width

int

-

height

long

-

pts

VeLivePlayerVideoTexture

null

texture

ByteBuffer

null

buffer

byte[]

null

data

变量说明

bufferType

public VeLivePlayerVideoBufferType com.ss.videoarch.liveplayer.VeLivePlayerVideoFrame.bufferType

视频帧数据封装格式。详情请参见 VeLivePlayerVideoBufferType。

pixelFormat

public VeLivePlayerPixelFormat com.ss.videoarch.liveplayer.VeLivePlayerVideoFrame.pixelFormat

视频帧像素格式。详情请参见 VeLivePlayerPixelFormat。

width

public int com.ss.videoarch.liveplayer.VeLivePlayerVideoFrame.width

视频宽度,单位为 px。

height

public int com.ss.videoarch.liveplayer.VeLivePlayerVideoFrame.height

视频高度,单位为 px。

pts

public long com.ss.videoarch.liveplayer.VeLivePlayerVideoFrame.pts

视频帧的渲染时间戳。单位为 ms。

texture

public VeLivePlayerVideoTexture com.ss.videoarch.liveplayer.VeLivePlayerVideoFrame.texture = null

OpenGL 渲染的视频纹理数据。如果将 VeLivePlayerPixelFormat 设置为VeLivePlayerPixelFormatTexture,并将 VeLivePlayerVideoBufferType 设置为VeLivePlayerVideoBufferTypeTexture,SDK 会返回此视频数据类型。有关详细信息,请参阅VeLivePlayerVideoTexture。

buffer

public ByteBuffer com.ss.videoarch.liveplayer.VeLivePlayerVideoFrame.buffer = null

ByteBuffer 格式的视频数据。如果将 VeLivePlayerPixelFormat设置为VeLivePlayerPixelFormatRGBA32,并将 VeLivePlayerVideoBufferType 设置为VeLivePlayerVideoBufferTypeByteBuffer,则 SDK 会返回此视频数据类型。

data

public byte [] com.ss.videoarch.liveplayer.VeLivePlayerVideoFrame.data = null

ByteArray 格式的视频数据。如果将 VeLivePlayerPixelFormat 设置为“VeLivePlayerPixelFormatRGBA32”,并将 VeLivePlayerVideoBufferType 设置为“VeLivePlayerVideoBufferTypeByteArray”,则 SDK 会返回这种视频数据类型。

VeLivePlayerVideoTexture
public class com.ss.videoarch.liveplayer.VeLivePlayerVideoTexture

播放器视频纹理格式。

成员变量

类型

默认值

名称

int

-

texId

EGLContext

-

eglContext

变量说明

texId

public int com.ss.videoarch.liveplayer.VeLivePlayerVideoTexture.texId

视频纹理 ID。

eglContext

public EGLContext com.ss.videoarch.liveplayer.VeLivePlayerVideoTexture.eglContext

OpenGL ES 图形上下文环境,用于自定义渲染。将 EGLContext 绑定到 GLSurfaceView 或 TextureView 上,您可以在被绑定的 View 上进行自定义的 OpenGL ES 渲染。

VeLivePlayerStreamType
public enum com.ss.videoarch.liveplayer.VeLivePlayerDef.VeLivePlayerStreamType

直播播放流类型。

枚举值

类型

值

说明

VeLivePlayerStreamTypeMain

0

主路流。

VeLivePlayerStreamTypeBackup

1

备路流。

VeLivePlayerProperty
public class com.ss.videoarch.liveplayer.VeLivePlayerProperty

高级配置。

成员变量

类型

默认值

名称

String

"VeLivePlayerKeySetParamsLowLatencyFLV"

VeLivePlayerKeySetParamsLowLatencyFLV

String

"VeLivePlayerKeySetParamsHttpHeaders"

VeLivePlayerKeySetParamsHttpHeaders

String

"VeLivePlayerKeySetParamsRemoveQueryParams"

VeLivePlayerKeySetParamsRemoveQueryParams

变量说明

VeLivePlayerKeySetParamsLowLatencyFLV

public static final String com.ss.videoarch.liveplayer.VeLivePlayerProperty.VeLivePlayerKeySetParamsLowLatencyFLV = "VeLivePlayerKeySetParamsLowLatencyFLV"

设置 FLV 低延时(延时 2-3 秒)参数配置。具体使用方法,详见 FLV 低延时。

VeLivePlayerKeySetParamsHttpHeaders

public static final String com.ss.videoarch.liveplayer.VeLivePlayerProperty.VeLivePlayerKeySetParamsHttpHeaders = "VeLivePlayerKeySetParamsHttpHeaders"

设置播放器发起 HTTP 请求时携带的自定义请求头。常用于传递鉴权令牌(Token)、Cookie 或业务追踪标识等额外信息。具体使用方法,详见自定义 HTTP 请求头。

VeLivePlayerKeySetParamsRemoveQueryParams

public static final String com.ss.videoarch.liveplayer.VeLivePlayerProperty.VeLivePlayerKeySetParamsRemoveQueryParams = "VeLivePlayerKeySetParamsRemoveQueryParams"

设置是否去除 SDK 自动拼接到拉流地址中的 Query 参数,默认值为 false。开启后,实际请求地址会去除 SDK 自动拼接的 Query 参数,并保留原始拉流地址中已有的 Query 参数。具体使用方法,详见去除 SDK 自动拼接的 Query 参数。

  • true:去除 SDK 自动拼接的 Query 参数。
  • false:保留 SDK 自动拼接的 Query 参数。
VeLivePlayerLogLevel
public enum com.ss.videoarch.liveplayer.log.VeLivePlayerLogConfig.VeLivePlayerLogLevel

直播播放器日志打印级别。

枚举值

类型

值

说明

VeLivePlayerLogLevelVerbose

0

输出 VERBOSE、DEBUG、INFO、WARNING 和 ERROR 级别的日志。

VeLivePlayerLogLevelDebug

1

输出 DEBUG、INFO、WARNING 和 ERROR 级别的日志。

VeLivePlayerLogLevelInfo

2

输出 INFO、WARNING 和 ERROR 级别的日志。

VeLivePlayerLogLevelWarn

3

输出 WARNING 和 ERROR 级别的日志。

VeLivePlayerLogLevelError

4

输出 ERROR 级别的日志。

VeLivePlayerLogLevelNone

5

关闭日志打印。

VeLivePlayerAudioFrame
public class com.ss.videoarch.liveplayer.VeLivePlayerAudioFrame

音频帧数据。

成员变量

类型

默认值

名称

VeLivePlayerAudioBufferType

-

bufferType

int

-

sampleRate

int

-

channels

int

-

bitDepth

long

-

pts

byte[]

null

bufferArray

ByteBuffer[]

null

buffer

int

-

samples

变量说明

bufferType

public VeLivePlayerAudioBufferType com.ss.videoarch.liveplayer.VeLivePlayerAudioFrame.bufferType

音频帧数据封装格式,详情请参见 VeLivePlayerAudioBufferType。

sampleRate

public int com.ss.videoarch.liveplayer.VeLivePlayerAudioFrame.sampleRate

音频采样率,单位为 Hz。

channels

public int com.ss.videoarch.liveplayer.VeLivePlayerAudioFrame.channels

声道数。

  • 1:单声道;
  • 2:双声道。

bitDepth

public int com.ss.videoarch.liveplayer.VeLivePlayerAudioFrame.bitDepth

音频位深度。

pts

public long com.ss.videoarch.liveplayer.VeLivePlayerAudioFrame.pts

音频渲染时间戳。单位为 ms。

bufferArray

public byte [] com.ss.videoarch.liveplayer.VeLivePlayerAudioFrame.bufferArray = null

PCM 音频数据。byte[]类型

buffer

public ByteBuffer [] com.ss.videoarch.liveplayer.VeLivePlayerAudioFrame.buffer = null

PCM 音频数据。ByteBuffer[]类型

samples

public int com.ss.videoarch.liveplayer.VeLivePlayerAudioFrame.samples

音频采样点个数。

VeLivePlayerAudioBufferType
public enum com.ss.videoarch.liveplayer.VeLivePlayerDef.VeLivePlayerAudioBufferType

音频数据封装格式。

枚举值

类型

值

说明

VeLivePlayerAudioBufferTypeUnknown

0

未知格式。

VeLivePlayerAudioBufferTypeByteArray

1

ByteArray 格式。

VeLivePlayerRotation
public enum com.ss.videoarch.liveplayer.VeLivePlayerDef.VeLivePlayerRotation

视频顺时针旋转角度。

枚举值

类型

值

说明

VeLivePlayerRotation0

0

关闭旋转。

VeLivePlayerRotation90

1

顺时针旋转 90 度。

VeLivePlayerRotation180

2

顺时针旋转 180 度。

VeLivePlayerRotation270

3

顺时针旋转 270 度。

VeLivePlayerStreamInfo
public class com.ss.videoarch.liveplayer.hls.VeLivePlayerStreamInfo

HLS 视频流信息。

成员变量

名称类型默认值
widthint-
heightint-
bandwidthint-
urlString-

成员函数

名称返回
toStringString

变量说明

width

public int com.ss.videoarch.liveplayer.hls.VeLivePlayerStreamInfo.width

视频宽度,单位为 px。

height

public int com.ss.videoarch.liveplayer.hls.VeLivePlayerStreamInfo.height

视频高度,单位为 px。

bandwidth

public int com.ss.videoarch.liveplayer.hls.VeLivePlayerStreamInfo.bandwidth

流带宽,单位为比特/秒(bps)。

url

public String com.ss.videoarch.liveplayer.hls.VeLivePlayerStreamInfo.url

HLS 协议的视频流播放地址。

函数说明

toString

public String com.ss.videoarch.liveplayer.hls.VeLivePlayerStreamInfo.toString()

将 HLS 视频流信息转换为字符串。

返回值

包含 HLS 流的视频宽度、视频高度、流带宽和播放地址的字符串。

最近更新时间:2026.09.21 00:22:42
这个页面对您有帮助吗?
有用
有用
无用
无用