diff --git a/ios/Video/RCTVideo.m b/ios/Video/RCTVideo.m index f408045a2e..0479defd86 100644 --- a/ios/Video/RCTVideo.m +++ b/ios/Video/RCTVideo.m @@ -146,6 +146,11 @@ - (instancetype)initWithEventDispatcher:(RCTEventDispatcher *)eventDispatcher selector:@selector(audioRouteChanged:) name:AVAudioSessionRouteChangeNotification object:nil]; + + [[NSNotificationCenter defaultCenter] addObserver:self + selector:@selector(bandwidthUpdated:) + name:AVPlayerItemNewAccessLogEntryNotification + object:nil]; } return self; @@ -820,13 +825,6 @@ - (void)attachListeners name:AVPlayerItemPlaybackStalledNotification object:nil]; - [[NSNotificationCenter defaultCenter] removeObserver:self - name:AVPlayerItemNewAccessLogEntryNotification - object:nil]; - [[NSNotificationCenter defaultCenter] addObserver:self - selector:@selector(bandwidthUpdated:) - name:AVPlayerItemNewAccessLogEntryNotification - object:nil]; [[NSNotificationCenter defaultCenter] removeObserver:self name: AVPlayerItemFailedToPlayToEndTimeNotification object:nil];