用live-player组件官方示例代码拉取rtmp流,ios很快就拉到了流并立即显示画面没有任何延迟,Android需要等待3-6秒后才显示画面;
经过日志分析,在调用LivePlayerContext的play方法之后,Android端等待3-6秒之后bindstatechange才会回调组件状态,以下是完整输出日志;
Fri Oct 29 2021 10:29:18 GMT+0800 (CST)开始播放拉流//此处调用LivePlayerContext的play方法
play successFri Oct 29 2021 10:29:18 GMT+0800 (CST)
Invoke event statechange in component: index/index
Fri Oct 29 2021 10:29:22 GMT+0800 (CST)live-player statechange: {"code":-2302,"message":"Failed to get accelerated pull address"}
Invoke event statechange in component: index/index
Fri Oct 29 2021 10:29:22 GMT+0800 (CST)live-player statechange: {"code":2001,"message":"connection SUCCESS"}
Invoke event statechange in component: index/index
Fri Oct 29 2021 10:29:22 GMT+0800 (CST)live-player statechange: {"code":2002,"message":"begin receiving stream"}
Invoke event statechange in component: index/index
Fri Oct 29 2021 10:29:22 GMT+0800 (CST)live-player statechange: {"code":2008,"message":"Enables H264 hardware decoding"}
Invoke event statechange in component: index/index
Fri Oct 29 2021 10:29:22 GMT+0800 (CST)live-player statechange: {"code":2004,"message":"Video play started"}
Invoke event statechange in component: index/index
Fri Oct 29 2021 10:29:22 GMT+0800 (CST)live-player statechange: {"code":2026,"message":"Audio play started"}
Invoke event statechange in component: index/index
Fri Oct 29 2021 10:29:23 GMT+0800 (CST)live-player statechange: {"code":2009,"message":"Resolution changed to368x640"}
Invoke event statechange in component: index/index
Fri Oct 29 2021 10:29:23 GMT+0800 (CST)live-player statechange: {"code":2003,"message":"Render the first video frame(IDR)"}
目前出现问题的机型为所有Android手机都是这样,ios不存在这个问题基本秒开,Android微信版本号为:8.0.15
有解决方案了么兄弟