根据带宽和比特率确定初始 NetStream 缓冲区大小
我试图根据客户端计算的带宽和视频的比特率确定 NetStream.bufferTime 的初始值。
据我所知你不能这样做,因为你必须在调用 NetStream.play() 之前设置一个初始缓冲区(或使用默认的 2 秒),并且 FMS 不会调用 NetStream.onMetaData,而通常情况下,FMS 不会调用 NetStream.onMetaData找到视频数据速率,直到调用 NetStream.play() 后。
即使您在 onMetaData 回调期间修改 NetStream.bufferTime,当视频开始播放或 NetStatus 事件注册“NetStatus.Buffer.Full”时,它也不会生效。
因此我的问题是:
如何在调用 NetStream.play 之前找到视频数据速率?
- 或者
- 如何在实际播放开始和 NetStatus 之前重置初始 bufferTime事件以“NetStatus.Buffer.Full”触发
I'm trying to determine an initial value for NetStream.bufferTime based on the client's calculated bandwidth and the video's bitrate.
As far as I can tell you can't do this, because you must have an initial buffer set BEFORE you call NetStream.play() (or use the default 2 seconds) and FMS does not call NetStream.onMetaData, where one would normally find the videodatarate, until after NetStream.play() is called.
Even if you modify NetStream.bufferTime during the onMetaData call back it doesn't effect when the video starts playing or when the NetStatus event registers "NetStatus.Buffer.Full".
Therefore my question is:
How do I find the Video Data Rate BEFORE I call NetStream.play?
-Or-
How do how do I reset the initial bufferTime before acctual play back begins and the NetStatus event fires with "NetStatus.Buffer.Full"
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论