更新时间:2026-04-10 GMT+08:00
分享

onStatistics

事件说明

Streaming质量状态统计,周期性1秒回调一次。

回调参数说明

字段名

类型

是否必选

说明

event

Object

包含统计信息

  • event.rtt:int,数据往返时延(单位:ms)
  • event.fps:int,帧率(单位:帧/秒)
  • event.bitrate:int,一秒内接收到的video数据大小(单位:kb/s)
  • event.packetsLostRate:int,一秒内的丢包率
  • event.width:int,video的当前宽度
  • event.height:int,video的当前高度

调用示例

player.on("onStatistics", function (stat) {
    console.log("rtt:" + stat.rtt);
    console.log("fps:" + stat.fps);
    console.log("bitrate:" + stat.bitrate);
    console.log("width:" + stat.width);
    console.log("height:" + stat.height);
});

相关文档