From 48e941b42b2cfb9dba0e8f3c409c6d84368a51e3 Mon Sep 17 00:00:00 2001 From: Ron Farales Date: Wed, 31 May 2023 08:34:48 -0700 Subject: [PATCH] Reverted to older commit that uses React Native's built-in messenging system (removed PlaybackBitrateListener class) Fixed bitrate listener missing early bitrate reports by moving listener to initWithEventDispatcher method --- ios/Video/RCTVideo.m | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) 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];