Skip to content

Commit

Permalink
fix: clear the appwillterminate observer
Browse files Browse the repository at this point in the history
  • Loading branch information
daytime-em committed Nov 22, 2024
1 parent ba6387c commit b05fa4d
Showing 1 changed file with 2 additions and 16 deletions.
18 changes: 2 additions & 16 deletions MUXSDKStats/MUXSDKStats/MUXSDKPlayerBinding.m
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,6 @@ - (void)handleApplicationWillTerminate:(NSNotification *)notification {
[self stopMonitoringAVPlayerItem];

[MUXSDKCore destroyPlayer:self.name];

}

# pragma mark AVPlayerItemDidPlayToEndTimeNotification
Expand All @@ -210,20 +209,6 @@ - (void)handleDidPlayToEndTimeNotification:(NSNotification *)notification {
}
}

- (void)handleApplicationWillTerminate:(NSNotification *)notification {
[self dispatchViewEnd];
[self stopMonitoringAVPlayerItem];

[MUXSDKCore destroyPlayer:self.name];
}

- (void)handleApplicationWillTerminate:(NSNotification *)notification {
[self dispatchViewEnd];
[self stopMonitoringAVPlayerItem];

[MUXSDKCore destroyPlayer:self.name];
}

# pragma mark AVPlayerItemAccessLog

- (void)handleAVPlayerAccess:(NSNotification *)notif {
Expand Down Expand Up @@ -357,6 +342,8 @@ - (void)dealloc {
[[NSNotificationCenter defaultCenter] removeObserver:self name:RenditionChangeNotification object:nil];
[[NSNotificationCenter defaultCenter] removeObserver:self name:AVPlayerItemNewErrorLogEntryNotification object:nil];
[[NSNotificationCenter defaultCenter] removeObserver:self name:@"com.mux.connection-type-detected" object:nil];

[[NSNotificationCenter defaultCenter] removeObserver:self name:UIApplicationWillTerminateNotification object:nil];
}

- (void) safelyRemoveTimeObserverForPlayer {
Expand Down Expand Up @@ -406,7 +393,6 @@ - (void) safelyRemovePlayerItemObserverForKeyPath:(NSString *)keyPath {
}

- (void)detachAVPlayer {
// NSLog(@"%s: Detaching AVPlayer", __PRETTY_FUNCTION__);
if (_playerItem) {
[self stopMonitoringAVPlayerItem];
}
Expand Down

0 comments on commit b05fa4d

Please sign in to comment.