Skip to content

Commit

Permalink
Fixed player instance deprecating.
Browse files Browse the repository at this point in the history
Deactivating an audio session that has running I/O. All I/O should be stopped or paused prior to deactivating the audio session.
  • Loading branch information
cybitzix committed Aug 20, 2015
1 parent 5856723 commit 3ac0f57
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion HysteriaPlayer/HysteriaPlayer.m
Original file line number Diff line number Diff line change
Expand Up @@ -811,6 +811,7 @@ - (void)deprecatePlayer
{
NSError *error;
tookAudioFocus = NO;
[[AVAudioSession sharedInstance] setCategory:nil error:&error];
[[AVAudioSession sharedInstance] setActive:NO error:&error];
[[UIApplication sharedApplication] endReceivingRemoteControlEvents];
[[NSNotificationCenter defaultCenter]removeObserver:self name:AVPlayerItemDidPlayToEndTimeNotification object:nil];
Expand Down Expand Up @@ -855,4 +856,4 @@ - (void)addDelegate:(id<HysteriaPlayerDelegate>)delegate{}

- (void)removeDelegate:(id<HysteriaPlayerDelegate>)delegate{}

@end
@end

0 comments on commit 3ac0f57

Please sign in to comment.