I am playing a live audio stream using AVPlayer and AVPlayerItem and trying to determine the current bit rate in the stream. I searched the net and found this help: MPMovieController baud rate determination
Inspired by the stream above, I tried to compute it using the following code:
NSArray *logEvents=playerItem.accessLog.events; AVPlayerItemAccessLogEvent *event = (AVPlayerItemAccessLogEvent *)[logEvents lastObject]; double bitRate=event.observedBitrate;
But the bitRate variable bitRate always zero when it is checked inside the timer.
In fact, [logEvents count] also always zero.
Could you tell me what is wrong with the technique?
Thank you very much.
source share