bandwidth report for IOS
bandwidth report for IOS
This commit is contained in:
parent
654a76d6ef
commit
a1a0ca648c
@ -578,6 +578,22 @@ static int const RCTVideoUnset = -1;
|
|||||||
selector:@selector(playbackStalled:)
|
selector:@selector(playbackStalled:)
|
||||||
name:AVPlayerItemPlaybackStalledNotification
|
name:AVPlayerItemPlaybackStalledNotification
|
||||||
object:nil];
|
object:nil];
|
||||||
|
|
||||||
|
[[NSNotificationCenter defaultCenter] removeObserver:self
|
||||||
|
name:AVPlayerItemNewAccessLogEntryNotification
|
||||||
|
object:nil];
|
||||||
|
[[NSNotificationCenter defaultCenter] addObserver:self
|
||||||
|
selector:@selector(handleAVPlayerAccess:)
|
||||||
|
name:AVPlayerItemNewAccessLogEntryNotification
|
||||||
|
object:nil];
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
- (void)handleAVPlayerAccess:(NSNotification *)notification {
|
||||||
|
AVPlayerItemAccessLog *accessLog = [((AVPlayerItem *)notification.object) accessLog];
|
||||||
|
AVPlayerItemAccessLogEvent *lastEvent = accessLog.events.lastObject;
|
||||||
|
float lastEventNumber = lastEvent.indicatedBitrate;
|
||||||
|
RCTLog(@"Switch indicatedBitrate from: %f to: %f", lastEvent.observedBitrate, lastEvent.indicatedBitrate);
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)playbackStalled:(NSNotification *)notification
|
- (void)playbackStalled:(NSNotification *)notification
|
||||||
|
Loading…
Reference in New Issue
Block a user